Consider the following variable declarations and definitions in C i) int var_9 = 1; ii) int 9_var = 2; iii) int _ = 3; Choose… Read More
Tag Archives: C Quiz – 101
#include "stdio.h" int main() { void *pVoid; pVoid = (void*)0; printf("%lu",sizeof(pVoid)); return 0; } Pick the best statement for the above C program snippet. (A)… Read More
#include "stdlib.h" int main() { int *pInt; int **ppInt1; int **ppInt2; pInt = (int*)malloc(sizeof(int)); ppInt1 = (int**)malloc(10*sizeof(int*)); ppInt2 = (int**)malloc(10*sizeof(int*)); free(pInt); free(ppInt1); free(*ppInt2);… Read More
Assume int is 4 bytes, char is 1 byte and float is 4 bytes. Also, assume that pointer size is 4 bytes (i.e. typical case)… Read More
Suppose that in a C program snippet, followings statements are used. i) sizeof(int); ii) sizeof(int*); iii) sizeof(int**); Assuming size of pointer is 4 bytes and… Read More