void main()

{

printf(“sizeof (void *) = %d \n“, sizeof( void *));

printf(“sizeof (int *) = %d \n”, sizeof(int *));

printf(“sizeof (double *) = %d \n”, sizeof(double *));

printf(“sizeof(struct unknown *) = %d \n”, sizeof(struct
unknown *));

}



void main() { printf(“sizeof (void *) = %d \n“, sizeof( void *)); printf(..

Answer / susie

Answer : :

sizeof (void *) = 2

sizeof (int *) = 2

sizeof (double *) = 2

sizeof(struct unknown *) = 2

Explanation:

The pointer to any type is of same size.

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More C Code Interview Questions

#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


Code for 1>"ascii to string" 2>"string to ascii"

1 Answers   Aricent, Global Logic,


Give a one-line C expression to test whether a number is a power of 2.

10 Answers   Microsoft,


main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); }

1 Answers   DCE,


main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }

1 Answers  






struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }

1 Answers  


What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;

1 Answers  


Write a function to find the depth of a binary tree.

13 Answers   Adobe, Amazon, EFI, Imagination Technologies,


main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”

5 Answers   HCL,


Is it possible to print a name without using commas, double quotes,semi-colons?

7 Answers  


int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }

1 Answers  


To reverse an entire text file into another text file.... get d file names in cmd line

0 Answers   Subex,


Categories