LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Standard Template Library Reference (std::string) (https://www.linuxquestions.org/questions/programming-9/standard-template-library-reference-std-string-424971/)

lucky6969b 03-15-2006 02:03 AM

Standard Template Library Reference (std::string)
 
src/packet.cpp: In member function ‘bool MyPacket::CheckHeader()’:
src/packet.cpp:96: error: ‘struct std::string’ has no member named ‘SetAt’
src/packet.cpp:97: error: ‘struct std::string’ has no member named ‘SetAt’
make: *** [packet.o] Error 1

I used to attach to a website which displayed a very nicely ruled-out format of reference of the standard template library. And I forgot where I found it. Somethin' that can solve the errors above. Thanks for any hints
Jack

spooon 03-15-2006 02:53 AM

* http://www.cppreference.com/ for an overview
* http://www.sgi.com/tech/stl/table_of_contents.html for a very formal technical reference

string (indeed) has no "SetAt"

xhi 03-15-2006 08:32 AM

to change a char you have ::replace and also operator []

the easiest way.
string s = "hello";
s[0] = 'X';

paulsm4 03-15-2006 03:09 PM

Just FYI -

"setAt()" is a Microsoft thing; it has to do with the Microsoft-specific/MFC "CString" class, not the standard C++ "string" class.

If your code has one Microsoft dependency, it's likely that sooner or later you'll encounter others, too.

Also (not applicable to this post), please use the "[Edit]" button to change your mind about a posting (don't just create a new posting if you don't need to), and please use the "[code]" tags to delimit source code (it makes it *so* much easier to read - and so much less unappealing to answer the question ;-))

Thanx in advance .. PSM


All times are GMT -5. The time now is 07:51 PM.