dereferencing a pointer that is a member of a class instance

hello and sorry if this is a frequently asked question but is this how to access a value of a variable pointed to by a pointer that is a member of a class instance?

1
2
3
4
5
6
7
8
9
10
class foo
{
char* bar;
};

char bam = 'x';

foo boo;
boo.bar = &bam;
cout<< *(boo.bar); //is <- how to access what's at bam through boo.bar? 

thanks in advance.
*(boo.bar) or *boo.bar both works equally well.
You could have gone that last step and actually run your code.

http://ideone.com/5AH3d
Topic archived. No new replies allowed.