char *cptr,c;

void *vptr,v;

c=10; v=0;

cptr=&c; vptr=&v;



main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; p..

Answer / susie

Answer :

Compiler error (at line number 4): size of v is Unknown.


You can create a variable of type void * but not of type
void, since void is an empty type. In the second line you
are creating variable vptr of type void * and v of type void
hence an error.

Is This Answer Correct ?    7 Yes 1 No

Post New Answer

More C Code Interview Questions

Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

0 Answers  

main() { printf("%x",-1<<4); }

3 Answers   HCL, Sokrati, Zoho,

How to access command-line arguments?

4 Answers  

main() { printf("%d", out); } int out=100;

3 Answers  

What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }

1 Answers  

write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).

0 Answers   CDAC, College School Exams Tests,

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  

How to palindrom string in c language?

6 Answers   Google,

char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }

1 Answers  

main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  

Who could write how to find a prime number in dynamic array?

0 Answers  

How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to

11 Answers   Infosys, Deshaw,