C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-05-2009, 07:24 PM   #1
Registered User
 
Join Date: Aug 2007
Location: U.K.
Posts: 127
Viewing a buffer when using std::string advice.

I have a task to do about the std::string datatype.

To do the task I need to use the KDevelop IDE and be able to find the size of the buffer being used when performing operations upon strings, but never having used KDevelop before, I'm at a complete loss.

Could anyone be so kind as to give me some direction as how to go about viewing a buffer which is in use? Can it's contents be viewed within a window of the IDE, or would I have to call functions to 'cout' details about the buffer being used?

I'm at a complete loss about this, so any info is really appreciated.

Many many thanks.
Swerve is online now   Reply With Quote
Old 11-05-2009, 08:08 PM   #2
Guest
 
Sebastiani's Avatar
 
Join Date: Aug 2001
Posts: 4,923
I'm not sure how an IDE would give you much insight into the innerworkings of an STL container - it sounds to me that you're a bit confused, honestly. But generally speaking, you can 'view' an std::string by passing it to the cout object, and get the size with, well, the size( ) member function.
Sebastiani is offline   Reply With Quote
Old 11-06-2009, 08:24 PM   #3
Registered User
 
Join Date: Aug 2007
Location: U.K.
Posts: 127
Yes, seems I was Sebastiani.

Your advice was most helpful though.

Many thanks.
Swerve is online now   Reply With Quote
Old 11-09-2009, 09:16 AM   #4
Unregistered User
 
Yarin's Avatar
 
Join Date: Jul 2007
Posts: 925
You mentioned manipulating the string. STL string manipulation isn't done as it is in C, you can read about it here: C++ Reference
You can use the c_str() member to get a C style string if you need to (non-manipulative, though).
__________________
GCC 4.4.0, Code::Blocks 8.02, Fedora 11, x64
Yarin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost with wrong output erasm C Programming 8 10-06-2009 06:44 AM
Function call from another .c module Ali.B C Programming 14 08-03-2009 11:45 AM
Print out a buffer SwarfEye C Programming 4 09-08-2006 09:32 AM
writing a pack-style function, any advices? isaac_s C Programming 10 07-08-2006 08:09 PM
buffer contents swapping daluu C++ Programming 7 10-14-2004 02:34 PM


All times are GMT -6. The time now is 08:41 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22