Welcome Guest | Sign in | Register
Pointers - Discussion Page For Q.10741 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Pointers > Questions and Answers

Q: Predict the output or error(s) for the following?

main()
{
char *cptr,c;
void *vptr,v;
c=10; v=0;
cptr=&c; vptr=&v;
printf("%c%v",c,v);
}
A. No output B. 0
C. Compiler error D. None of these

Answer and Explanation

Answer:Compiler error

Explanation:
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.


Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.