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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -