Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-15-2006, 03:03 AM   #1
Registered: Nov 2005
Posts: 337

Rep: Reputation: 30
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
Old 03-15-2006, 03:53 AM   #2
Senior Member
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 50
* for an overview
* for a very formal technical reference

string (indeed) has no "SetAt"

Last edited by spooon; 03-15-2006 at 03:55 AM.
Old 03-15-2006, 09:32 AM   #3
Senior Member
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

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

the easiest way.
string s = "hello";
s[0] = 'X';
Old 03-15-2006, 04:09 PM   #4
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SIGSEGV for std::string dragondad Programming 2 02-05-2006 12:26 PM
std::string in write lucky6969b Programming 2 12-20-2005 11:53 PM
Can't use template with std::map astorm Programming 3 11-03-2005 07:55 PM
C++ std::string to int Slaxx Programming 1 10-30-2004 11:03 PM
std string class and printf The_Nerd Programming 3 06-28-2004 11:46 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration