Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralReading and Loading files Pin
Notsosuperhero23-Mar-05 15:51
Notsosuperhero23-Mar-05 15:51 
GeneralRe: Reading and Loading files Pin
David Crow23-Mar-05 16:43
David Crow23-Mar-05 16:43 
GeneralRe: Reading and Loading files Pin
Christian Graus23-Mar-05 16:45
protectorChristian Graus23-Mar-05 16:45 
GeneralRe: Reading and Loading files Pin
namaskaaram23-Mar-05 19:55
namaskaaram23-Mar-05 19:55 
GeneralMenu Item Check State Pin
Jumpin' Jeff23-Mar-05 15:22
Jumpin' Jeff23-Mar-05 15:22 
GeneralRe: Menu Item Check State Pin
Christian Graus23-Mar-05 15:42
protectorChristian Graus23-Mar-05 15:42 
GeneralRe: Menu Item Check State Pin
Jumpin' Jeff24-Mar-05 2:12
Jumpin' Jeff24-Mar-05 2:12 
GeneralSimple String Input Pin
cockytrumpet23-Mar-05 14:40
susscockytrumpet23-Mar-05 14:40 
Maybe I just haven't seen a good example of parsing input, but you'd think it would be easier. This is what I've seen done:

...
char input[20];
string theString;

cin.getline(input, 20);
theString = string(input);

myObject A(theString);
...


But, I need to parse theString in the constructor of A, so I need to do something like...

...
private:
     int firstNumber;
...
int x = 0;

while(isdigit(theString[x])) {
     x++;
}
firstNumber = atoi(theString.substr(0,x));
...


...which doesn't work. If anybody could share the more elegant (and functional Wink | ;) ) approach that they use, I would be most gratefull.
GeneralRe: Simple String Input Pin
Christian Graus23-Mar-05 15:47
protectorChristian Graus23-Mar-05 15:47 
GeneralRe: Simple String Input Pin
cockytrumpet23-Mar-05 16:40
susscockytrumpet23-Mar-05 16:40 
GeneralRe: Simple String Input Pin
Christian Graus23-Mar-05 17:21
protectorChristian Graus23-Mar-05 17:21 
GeneralRe: Simple String Input Pin
cockytrumpet23-Mar-05 18:02
susscockytrumpet23-Mar-05 18:02 
GeneralRe: Simple String Input Pin
David Crow23-Mar-05 16:46
David Crow23-Mar-05 16:46 
GeneralKnowing when no data is @ Serial Port Pin
CNewbie23-Mar-05 13:32
CNewbie23-Mar-05 13:32 
GeneralRe: Knowing when no data is @ Serial Port Pin
Mircea Puiu24-Mar-05 5:15
Mircea Puiu24-Mar-05 5:15 
GeneralMFC Chart Pin
Coremn23-Mar-05 13:19
Coremn23-Mar-05 13:19 
GeneralRe: MFC Chart Pin
David Crow23-Mar-05 16:48
David Crow23-Mar-05 16:48 
GeneralRe: MFC Chart Pin
Coremn23-Mar-05 16:53
Coremn23-Mar-05 16:53 
GeneralOpenGL and CView problem Pin
FayezElFar23-Mar-05 11:50
FayezElFar23-Mar-05 11:50 
GeneralRe: OpenGL and CView problem Pin
Alexander M.,23-Mar-05 12:19
Alexander M.,23-Mar-05 12:19 
GeneralRe: OpenGL and CView problem Pin
FayezElFar24-Mar-05 4:25
FayezElFar24-Mar-05 4:25 
GeneralSimple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:01
sacoskun23-Mar-05 10:01 
GeneralRe: Simple error, but how to solve?:( Pin
PJ Arends23-Mar-05 10:09
professionalPJ Arends23-Mar-05 10:09 
GeneralRe: Simple error, but how to solve?:( Pin
sacoskun23-Mar-05 10:21
sacoskun23-Mar-05 10:21 
GeneralRe: Simple error, but how to solve?:( Pin
Barry Etter23-Mar-05 10:39
Barry Etter23-Mar-05 10:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.