ostringstream Question44 (4/30/2013 11:49:39 PM) comp.lang.c++ How can I clear/reset/initialize an ostringstream object? I've tried
both clear() and flush() calls to reset an object I've used (so that I
can reuse it), but neither works: subsequent uses only append ... mrc2323
stringstream Problems #266 (4/26/2013 10:52:10 PM) comp.lang.c++ I am trying to use stringstreams to parse some complex data. In the
code below, myTest is a string that contains int (9), char ('M'),
string ("45-49") and
string (" Male Age Group 45-49") data fiel... mrc2323
STL Map Problem #2310 (3/30/2013 10:24:27 PM) comp.lang.c++ I am developing a small (and seemingly simple) STL map application,
yet I can't get a clean compile. Below is code that produces a compiler
error on the "find" call, where the compiler doesn't accept th... mrc2323
Sorting Structure Data within Vector215 (3/27/2013 7:20:41 PM) comp.lang.c++ I am trying to convert an array-based application to a vector-based
implementation, mostly because I need to expand the data being processed
beyond a fixed array I've declared (CTSMAX), but also to make ... mrc2323
Parsing (a Series of) Variables2215 (3/24/2013 12:38:42 AM) comp.lang.c++ How do I (or can I?) parse a variable number of numeric values from a
line of text? Below is an example of a data line I need to parse (14
values, but there can be more or less):
1 37 36 4 7 5 ... mrc2323
A Better Way?3417 (3/8/2013 9:21:15 PM) comp.lang.c++ Is there a better way (less code, less convoluted, etc.) to access
the last character of a string variable than this?:
if(str2.at(str2.length()-1) != '/') str2 +="/";
... mrc2323
Passing C++ string Results1625 (1/19/2013 10:41:34 PM) comp.lang.c++ I have the following function, but it fails after the first
invocation whenever the length of the input variable is longer than the
previous data. Specifically:
strToUpper("5h"); // works
s... mrc2323
Erase Last Character of basic::string Variable648 (12/11/2012 12:11:35 AM) comp.lang.c++ How do I remove the last character of a basic::string? Specifically,
I'm using fgets to read lines from a text file, and each ends with the
characters '\10' and '\0'. When I assign the c-string variabl... mrc2323
2 Iterators/Iterator Math244 (11/26/2012 3:42:55 AM) comp.lang.c++ I am trying to print/display a list of strings in 2 columns. My
attempt to use 2 iterators (one for the first half of the list and
another for the 2nd half) doesn't compile - and I can't establish the
... mrc2323
Parsing Numeric Data #2331 (11/8/2012 3:42:35 PM) comp.lang.c++ The function below (parseNum) seems convoluted and possibly
faulty...although it seems to work. In the code invocation (far below)
the data is real-world, and I wish to parse only the first 6 numeric
... mrc2323
ostringstream Question44 (4/30/2013 11:49:39 PM) comp.lang.c++ How can I clear/reset/initialize an ostringstream object? I've tried
both clear() and flush() calls to reset an object I've used (so that I
can reuse it), but neither works: subsequent uses only append ... mrc2323(170)
stringstream Problems #266 (4/26/2013 10:52:10 PM) comp.lang.c++ I am trying to use stringstreams to parse some complex data. In the
code below, myTest is a string that contains int (9), char ('M'),
string ("45-49") and
string (" Male Age Group 45-49") data fiel... mrc2323(170)
Parsing (a Series of) Variables2215 (3/24/2013 12:38:42 AM) comp.lang.c++ How do I (or can I?) parse a variable number of numeric values from a
line of text? Below is an example of a data line I need to parse (14
values, but there can be more or less):
1 37 36 4 7 5 ... mrc2323(170)
Preferred Style Question1342 (9/25/2012 4:39:22 PM) comp.lang.c++ What are some accepted ways to do the following calculation - and
avoid the compiler warnings that expose conversion data loss? (I'm
trying to compute the total time in seconds that a person has to
co... mrc2323(170)
Using Class Objects936 (7/31/2012 8:38:41 PM) comp.lang.c++ I'm trying to learn and adopt some new programming techniques, and
I've reached a roadblock. Specifically, although I have most of a class
defined and declared, I don't know how to use it.
In the c... mrc2323(170)
Include Files Directory Structure747 (6/10/2012 7:31:25 PM) comp.lang.c++ For years, I've been placing all my projects and all my various
include files in a single directory (CPP). It's now quite large (and
messy!), and I'm trying to convert my code to a newer compiler. This... mrc2323(170)
Access Violation Problem #21784 (6/2/2012 8:44:53 PM) comp.lang.c++ I have the following code that compiles but produces a "Access
violation reading location..." runtime error when executed. I tried
casting the first statement to (char*), but that produced the same
fa... mrc2323(170)
C-style Strings to LPCWSTR1292 (5/26/2012 2:48:56 AM) comp.lang.c++ How can I convert a C-style string variable to LPCWSTR? I have code
that used to work on VC6.0 that didn't seem to care that a function call
that accepts an LPCWSTR argument wasn't that type, but now th... mrc2323(170)
fstream Buffers3342 (5/17/2012 8:34:40 PM) comp.lang.c++ I have the following routine that determines the time required to copy a large text file to another. I'm comparing this code to a class I wrote (too large to post here) that does text file I/o with explic... mrc2323(170)
Some Basics - strings and Conversions1025 (4/16/2012 11:07:37 PM) comp.lang.c++ In the following code, even though the program executes, the 2nd prompt fails to process data. The 1st prompt requires 2 returns (why is that?), but the 2nd doesn't: it prompts, waits for data, and goes o... mrc2323(170)