C++ : Using void to create variables -
i learning c++ on own internet. wondering if can create variable of void
type. if , how can you? these variables used for?
this not work:
void b; cout<<b;
error:
size of b unknown or zero
thanks :)
"i wondering if can create variable of void type."
no, compiler told you.
if , how can you?"
see above.
"also these variables used for?"
it won't useful, because void
explicitly designates no type.
"so wat void pointer used for?"
as comment:
it's used store address of object of type. unless don't know exact original type, it's pretty useless well.
Comments
Post a Comment