Dumb, generic pointer question

I'm looking at some linked-list code from class and trying to figure it out. Generally, when I'm looking at new code, I like to see if I can figure out what it's doing with pencil and paper and then use copious amounts of print statements to see whether or not I'm right. However, when you're working with pointers that may or may not be null pointers, that doesn't quite work. Using cout statements to print something like pointer->data if the pointer happens to be pointing at nothing just makes the compiler mad. What would you recommend? Thanks for your time.
	if(pointer != NULL)
		cout << *pointer;
Topic archived. No new replies allowed.