Hi all,
I want to know if there is a smart way in c++ to test if my variable (or pointer) was already initialized? For example, I have a linked list, and I want to add an item to that list.
If would like to do some thing
if (!(initialized(*head) )) { // if head wasn't initialized
// ...
// create first item, and save this pointer as head of this list
} else { head already exists. Create the next link
// ...
}
Any suggestions how to go about it?
Thanks,
-R