![]() |
| | #1 |
| Registered User Join Date: Aug 2007 Location: U.K.
Posts: 127
| Viewing a buffer when using std::string advice. 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 | |
| | #2 |
| Guest 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 | |
| | #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 | |
| | #4 |
| Unregistered User 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 | |
![]() |
| Thread Tools | |
| Display Modes | |
|
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 |