Pointers C Questions And Answers
Here you can find Pointers C Questions and Answers.
Why Pointers C Questions and Answers Required?
In this Pointers C Questions and Answers section you can learn and practice Pointers C Questions and Answers to improve your skills in order to face technical inerview conducted by Banks. By Practicing these
interview questions, you can easily crack any Bank Exams interview.
Where can I get Pointers C Questions and Answers?
AllIndiaExams provides you lots Pointers C Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download Pointers C Questions
and Answers as PDF files and eBooks.
How to solve these Pointers C Questions and Answers?
You no need to worry, we have given lots of Pointers C Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Bank Exams interview.
Pointers C Questions and Answers
1. What is the output of this C code?
int main()
{
char *p = NULL;
char *q = 0;
if (p)
printf(" p ");
else
printf("nullp");
if (q)
printf("q\n");
else
printf(" nullq\n");
}
Pointers C Questions and Answers
2. What is the output of this C code?
int main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
return 0;
}
Pointers C Questions and Answers
3. What is the output of this C code?
int main()
{
int i = 10;
void *p = &i;
printf("%f\n", *(float*)p);
return 0;
}
Pointers C Questions and Answers
4. What is the output of this C code?
int *f();
int main()
{
int *p = f();
printf("%d\n", *p);
}
int *f()
{
int *j = (int*)malloc(sizeof(int));
*j = 10;
return j;
}
Pointers C Questions and Answers
5. What is the output of this C code?
int *f();
int main()
{
int *p = f();
printf("%d\n", *p);
}
int *f()
{
int j = 10;
return &j;
}
Pointers C Questions and Answers
6. What is the output of this C code?
int main()
{
int *ptr, a = 10;
ptr = &a;
*ptr += 1;
printf("%d,%d/n", *ptr, a);
}
Pointers C Questions and Answers
7. Comment on the following?
const int *ptr;
Pointers C Questions and Answers
8. Which is an indirection operator among the following?
Pointers C Questions and Answers
9. Which of the following does not initialize ptr to null (assuming variable declaration of a as int a=0)?
Pointers C Questions and Answers
10. What is the output of this C code?
int x = 0;
void main()
{
int *ptr = &x;
printf("%p\n", ptr);
x++;
printf("%p\n ", ptr);
}