|
From: Per W. <pw...@ia...> - 2003-07-10 06:03:01
|
Yes, with char* AddUser etc must do strdup() or similar of the strings, to make them available for the lifetime of the user objects. However, when locating entries, it doesn't matter if the strings sent in to the Find() have different addresses. /Per W On Thu, 10 Jul 2003, Ioannis Vranos wrote: > > -----Original Message----- > > From: Per Westermark [mailto:pw...@ia...] > > Sent: Thursday, July 10, 2003 3:29 AM > > To: Ioannis Vranos > > Cc: Dev-C++ Mailing List > > Subject: RE: [Dev-C++] STL Map question > > > > > > Did I miss something? > > > > The compare function doesn't look for similar addresses - it > > performs a > > full string compare. How would std::string make a difference? > > > In the implementations of > > > void AddUser(User *pUser); > bool DeleteUser(const char *pNick); > User *FindUser(const char *pNick); > > > in someone of which it probably crashes. > > > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |