Weird problem with sscanf
Hi, I've got a weird problem here:
I have a routine of reading from a file and getting some values for the variables from it. Here's the problem:
Code:
...
sscanf ( buffer,"%d : %d : %d : %d : %d",&mWidth, &mHeight, &mTransCol.transR, &mTransCol.transG , &mTransCol.transB);
...
and the buffer's value (from debug) is:
Code:
buffer = "22 : 21 : 1 : 2 : 3\r\n\000..."
the value of variables are:
Code:
mWidth=0
mHeight=21
mTransCol.transR=1
mTransCol.transG=2
mTransCol.transB=3
I'm confused. Why does the mWidth is 0 whereas in the buffer string it's clearly 22 ?? Can anybody help me with this?