Click here to Skip to main content
15,920,633 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Cstring to char * error Pin
Michael Dunn21-Jun-06 8:51
sitebuilderMichael Dunn21-Jun-06 8:51 
GeneralRe: Cstring to char * error Pin
kitty521-Jun-06 9:28
kitty521-Jun-06 9:28 
GeneralRe: Cstring to char * error Pin
Zac Howland21-Jun-06 9:35
Zac Howland21-Jun-06 9:35 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:38
David Crow21-Jun-06 9:38 
AnswerRe: Cstring to char * error Pin
Zac Howland21-Jun-06 13:20
Zac Howland21-Jun-06 13:20 
QuestionRe: Cstring to char * error Pin
David Crow22-Jun-06 2:33
David Crow22-Jun-06 2:33 
AnswerRe: Cstring to char * error Pin
Zac Howland22-Jun-06 3:20
Zac Howland22-Jun-06 3:20 
GeneralRe: Cstring to char * error Pin
David Crow22-Jun-06 3:35
David Crow22-Jun-06 3:35 
Zac Howland wrote:
...while keeping track of where you are in the original string.


Are you sure?

Since the goal was to simply split the user input into four pieces, what's wrong with replacing:

sscanf( userIn, "%s %s %s %s", device.GetBuffer(25), cmd.GetBuffer(25), input1.GetBuffer(25), input2.GetBuffer(25) );
with:

AfxExtractSubString(device, userIn, 0, ' ');
AfxExtractSubString(cmd, userIn, 1, ' ');
AfxExtractSubString(input1, userIn, 2, ' ');
AfxExtractSubString(input2, userIn, 3, ' ');
All of the array stuff was not part of the original problem.


"The largest fire starts but with the smallest spark." - David Crow

"Judge not by the eye but by the heart." - Native American Proverb


GeneralRe: Cstring to char * error Pin
Zac Howland22-Jun-06 3:39
Zac Howland22-Jun-06 3:39 
GeneralRe: Cstring to char * error Pin
kitty521-Jun-06 9:52
kitty521-Jun-06 9:52 
GeneralRe: Cstring to char * error Pin
David Crow21-Jun-06 10:15
David Crow21-Jun-06 10:15 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:36
David Crow21-Jun-06 9:36 
AnswerRe: Cstring to char * error Pin
kitty521-Jun-06 9:50
kitty521-Jun-06 9:50 
GeneralRe: Cstring to char * error Pin
David Crow21-Jun-06 10:16
David Crow21-Jun-06 10:16 
GeneralRe: Cstring to char * error Pin
Zac Howland21-Jun-06 13:23
Zac Howland21-Jun-06 13:23 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:12
David Crow21-Jun-06 9:12 
AnswerRe: Cstring to char * error [modified] Pin
kitty521-Jun-06 9:29
kitty521-Jun-06 9:29 
QuestionRe: Cstring to char * error Pin
David Crow21-Jun-06 9:35
David Crow21-Jun-06 9:35 
Questionlist in mfc Pin
kamalesh8221-Jun-06 7:42
kamalesh8221-Jun-06 7:42 
AnswerRe: list in mfc Pin
led mike21-Jun-06 7:55
led mike21-Jun-06 7:55 
GeneralRe: list in mfc Pin
kamalesh8221-Jun-06 8:00
kamalesh8221-Jun-06 8:00 
GeneralRe: list in mfc [modified] Pin
Zac Howland21-Jun-06 8:35
Zac Howland21-Jun-06 8:35 
QuestionRe: list in mfc Pin
David Crow21-Jun-06 9:11
David Crow21-Jun-06 9:11 
AnswerRe: list in mfc Pin
led mike21-Jun-06 10:19
led mike21-Jun-06 10:19 
AnswerRe: list in mfc Pin
Hamid_RT21-Jun-06 19:31
Hamid_RT21-Jun-06 19:31 

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.