Re: sscanf problem
Re: sscanf problem
- Subject: Re: sscanf problem
- From: Marco Scheurer <email@hidden>
- Date: Wed, 28 Jan 2004 14:46:30 +0100
I've got a strange problem using sscanf:
const char *s;
char theString[ 256 ];
s = "123 456 \"blah\"";
int theInt1;
int theInt2;
sscanf( s, "%d %d \"%s\"", &theInt1, &theInt2, theString );
NSLog(@"%@",[NSString stringWithCString:theString]);
This returns a string 'blah"' - and i've no idea why i get a quote
sign at
the end of the string.
Anyone knows why this happens and how to fix that?
Probably off-topic, but from man sscanf:
%s Matches a sequence of non-white-space characters [...].
Double-quote is not white space, so maybe you wanted a pattern like:
"%d %d \"%[^\"]\""
Marco Scheurer
Sen:te, Lausanne, Switzerland
http://www.sente.ch
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.