What is the difference between *p++ and (*p)++?
What does the following code do?
int *p = (int*)malloc(sizeof(int));
*p = 5;
free(p);
p = NULL;
Which statement is true about void pointers?
What is the output?
int x = 50;
int *p = &x;
int *q = p;
q = NULL;
printf("%d", *p);
In a function that returns a pointer, which of the following is UNSAFE?
Advertisement
Consider: int *p = (int *)malloc(5 * sizeof(int)); for(int i=0; i<5; i++) *(p+i) = i*10; Which statement correctly deallocates this memory?
A programmer uses a pointer variable but forgets to initialize it before dereferencing. Which type of error will occur?
What is the relationship between arrays and pointers in C?
What will be the output?
int arr[3][3] = {{1,2,3}, {4,5,6}, {7,8,9}};
int *p = (int *)arr;
printf("%d", *(p+5));
What does realloc() do?
What is the primary use of const pointer (int * const p)?
Consider: int arr[] = {1,2,3,4,5}; int *p = arr + 2; What is arr - p?
What is malloc(0) likely to return?
What will be printed?
int *p = (int*)malloc(5 * sizeof(int));
int *q = p;
p = NULL;
free(q);
What is the difference between arr and &arr if arr is an array?
int arr[5];
In pointer to function: int (*ptr)(int, int); What does this declare?
What is the output of: printf("%p", NULL);?
For dynamic 2D array: int arr = (int)malloc(n * sizeof(int*)); What's missing?
What is the relationship between arrays and pointers?
Consider: const int *p; and int * const q; Which statement is true?