Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!jarthur!nntp-server.caltech.edu!todd From: todd@Quotron.COM (Todd Booth) Newsgroups: comp.lang.c++ Subject: possible to overload << and pass an object ptr? Keywords: overload Message-ID: Date: 23 Mar 91 20:10:03 GMT Sender: news@nntp-server.caltech.edu Organization: California Institute of Technology, Pasadena Lines: 21 Consider the following struct: struct S { void operator<<(char p1) { cout << p1; } }; S *o2 = new S; o2 << 'a'; // error <--- How can I resolve this? *o2 << 'a'; // no problem, but ugly S o1; o1 << 'a'; // no problem thanks, --todd -- todd (booth) todd@quotron.com 213 302-4368