string class

From: Karl B Buchner (zerker@juno.com)
Date: 02/09/02


I am using the following code to show a character a room:
void character::showroom(room *r){
 character *ch;
 string buf;
 if(!r)
  r = in;
 (buf = r->name) += "\r\n";
 if(!(flags.test(BRIEF)))
  (buf += r->description) += "\r\n";
 for(ch = r->people; ch != NULL; ch = ch->roomnext)
  if(ch != this)
   buf += ch->show(this);
 buf += "\r\n";
 if(flags.test(AUTOEXIT)){
  for(int i = 0; i < NUMDIRS; i++)
   if(r->exits[i])
    ((buf += dirs[i]) += r->exits[i]->name) += "\r\n\r\n";
 }
 *this << buf.pointer;
}


*this << buf.pointer should send the contents of buf to the character
(*this << "Huh?\r\n"; works fine)

I get the following compile error, however:

C:\Dynamic\src\character.cpp(268) : error C2274: 'function-style cast' :
illegal as right side of '.' operator

I looked at the documentation for the error, and it says I should use the
operator keyword
before pointer, but buf.operator pointer causes a ton of errors.

Any help appreciated,

^Blaize^
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT