Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: sscanf: parsing a file Pin
jeron126-Mar-10 3:55
jeron126-Mar-10 3:55 
GeneralRe: sscanf: parsing a file Pin
Tim Craig26-Mar-10 8:28
Tim Craig26-Mar-10 8:28 
AnswerRe: sscanf: parsing a file Pin
Iain Clarke, Warrior Programmer26-Mar-10 4:37
Iain Clarke, Warrior Programmer26-Mar-10 4:37 
GeneralRe: sscanf: parsing a file Pin
CPallini26-Mar-10 9:25
mveCPallini26-Mar-10 9:25 
GeneralRe: sscanf: parsing a file Pin
Tim Craig26-Mar-10 18:21
Tim Craig26-Mar-10 18:21 
GeneralRe: sscanf: parsing a file Pin
CPallini27-Mar-10 5:30
mveCPallini27-Mar-10 5:30 
GeneralRe: sscanf: parsing a file Pin
Tim Craig27-Mar-10 8:13
Tim Craig27-Mar-10 8:13 
AnswerRe: sscanf: parsing a file Pin
David Crow26-Mar-10 4:47
David Crow26-Mar-10 4:47 
After your tirade to other professionals here, you surely do not deserve any help.

tom groezer wrote:
I need to parse a file...
I'm using sscanf function.


Which means you are using the wrong tool for the job. fscanf() would be used to parse the file, while sscanf() would be used to parse a string read from the file. There is a subtle but big difference. Learn that difference and you'll save yourself many bouts with foot-in-mouth disease.

tom groezer wrote:
How do I ensure that I skip the spaces and tabs which could be in randon number.


Is it really that hard to find something like:

char *str = "I  really\tdo \t not  deserve    any\t  help";
char s1[8], s2[8], s3[8], s4[8], s5[8], s6[8], s7[8];
sscanf(str, "%s %s %s %s %s %s %s", s1, s2, s3, s4, s5, s6, s7);

"One man's wage rise is another man's price increase." - Harold Wilson

"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

"Man who follows car will be exhausted." - Confucius


QuestionAdler32 Algorithm Doubts Pin
rupeshkp72825-Mar-10 23:42
rupeshkp72825-Mar-10 23:42 
QuestionRe: Adler32 Algorithm Doubts Pin
CPallini26-Mar-10 1:09
mveCPallini26-Mar-10 1:09 
AnswerRe: Adler32 Algorithm Doubts Pin
tom groezer26-Mar-10 1:38
tom groezer26-Mar-10 1:38 
GeneralRe: Adler32 Algorithm Doubts Pin
CPallini26-Mar-10 1:44
mveCPallini26-Mar-10 1:44 
AnswerRe: Adler32 Algorithm Doubts Pin
rupeshkp72828-Mar-10 19:19
rupeshkp72828-Mar-10 19:19 
QuestionWxWidgets question about wxFileSystem and wxFSFile Pin
brdavid25-Mar-10 21:28
brdavid25-Mar-10 21:28 
AnswerRe: WxWidgets question about wxFileSystem and wxFSFile Pin
Stuart Dootson25-Mar-10 21:54
professionalStuart Dootson25-Mar-10 21:54 
GeneralRe: WxWidgets question about wxFileSystem and wxFSFile Pin
brdavid26-Mar-10 0:26
brdavid26-Mar-10 0:26 
Questionlocalization issue Pin
Member 59031025-Mar-10 21:27
Member 59031025-Mar-10 21:27 
AnswerRe: localization issue Pin
KarstenK25-Mar-10 22:47
mveKarstenK25-Mar-10 22:47 
GeneralRe: localization issue Pin
Member 59031025-Mar-10 23:26
Member 59031025-Mar-10 23:26 
GeneralRe: localization issue Pin
Eugen Podsypalnikov25-Mar-10 23:35
Eugen Podsypalnikov25-Mar-10 23:35 
GeneralRe: localization issue Pin
Member 59031025-Mar-10 23:54
Member 59031025-Mar-10 23:54 
GeneralRe: localization issue Pin
Eugen Podsypalnikov26-Mar-10 0:03
Eugen Podsypalnikov26-Mar-10 0:03 
GeneralRe: localization issue Pin
Member 59031026-Mar-10 0:06
Member 59031026-Mar-10 0:06 
Questionrun under CScript Pin
john563225-Mar-10 20:37
john563225-Mar-10 20:37 
AnswerRe: run under CScript Pin
Richard MacCutchan26-Mar-10 0:29
mveRichard MacCutchan26-Mar-10 0:29 

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.