C Programming :: Pointers
-
What will be the output of the program ?
#include
int main() { static char *s[] = {"black", "white", "pink", "violet"}; char **ptr[] = {s+3, s+2, s+1, s}, ***p; p = ptr; ++p; printf("%s", **p+1); return 0; } -
What will be the output of the program ?
#include
int main() { int i=3, *j, k; j = &i; printf("%d\n", i**j*i+*j); return 0; } -
What will be the output of the program ?
#include
int main() { int x=30, *y, *z; y=&x; /* Assume address of x is 500 and integer is 4 byte size */ z=y; *y++=*z++; x++; printf("x=%d, y=%d, z=%d\n", x, y, z); return 0; } -
What will be the output of the program ?
#include
-
What will be the output of the program If the integer is 4bytes long?
#include
int main() { int ***r, **q, *p, i=8; p = &i; q = &p; r = &q; printf("%d, %d, %d\n", *p, **q, ***r); return 0; } -
What will be the output of the program ?
#include
int main() { char *str; str = "%s"; printf(str, "K\n"); return 0; } -
What will be the output of the program ?
#include
int *check(static int, static int); int main() { int *c; c = check(10, 20); printf("%d\n", c); return 0; } int *check(static int i, static int j) { int *p, *q; p = &i; q = &j; if(i >= 45) return (p); else return (q); } -
What will be the output of the program if the size of pointer is 4-bytes?
#include
int main() { printf("%d, %d\n", sizeof(NULL), sizeof("")); return 0; } -
What will be the output of the program ?
#include
int main() { void *vp; char ch=74, *cp="JACK"; int j=65; vp=&ch; printf("%c", *(char*)vp); vp=&j; printf("%c", *(int*)vp); vp=cp; printf("%s", (char*)vp+2); return 0; } -
#include
int main() { int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7, 8}; int *p, *q; p = &arr[1][1][1]; q = (int*) arr; printf("%d, %d\n", *p, *q); return 0; }