I know what that is printing silly! =p I mentioned it in my OP.
I'm just overloading the default behavior of the stream insertion operator to handle a shell type struct. I didn't bother to return anything because I'm just playing with code, and the return isn't required (I think) to get the printing behavior. Seeing as how it /does/ print out.
The thing is, I can't de-reference s.l using *s.l to get the value. I get a compile error.
How would I make it print out s.l's value instead of address, considering that dereferencing it isn't working?
I would greatly appreciate any insight on the matter.
sorry I still can't follow your train of thought here,
Sethe wrote:
I'm just overloading the default behavior of the stream insertion operator to handle a shell type struct. I didn't bother to return anything because I'm just playing with code, and the return isn't required (I think) to get the printing behavior. Seeing as how it /does/ print out.
if you want to dereference an object and print it, it's just like normal
1 2 3 4 5 6 7 8 9
int* pvar = &var; // var has already been declared & initialized
// do something with *pvar
...
cout << *pvar; // to see the results, this is the 'normal' overloading of <<
// using a user-defined object is no different
UserType obj; // obj is initialized with empty contructor
UserType* pobj = &obj;
cout << *pobj; // now you're calling the overloaded << defined above and dereferencing your object
what I meant with the line 27 remark was you're not using the overloaded << operator that you defined ;)