[HELP] SSCANF problem
#1

Hy, i am trying to retrieve multiple info from a string with sscanf.
Here's my code:
Код:
printf("%s", string);
sscanf(string, "i", id);
sscanf(string, "{i}s[32]iiis[16]", HouseInfo[id][hDescription], HouseInfo[id][hPrice], HouseInfo[id][hMoney], HouseInfo[id][hRent], HouseInfo[id][hOwner]);
printf("%s %d %d %d %s", HouseInfo[id][hDescription], HouseInfo[id][hPrice], HouseInfo[id][hMoney], HouseInfo[id][hRent], HouseInfo[id][hOwner]);
And this is what i get in console:
EX1:
Код:
1 8 Room Luxury 625000 0 0 The State
8 0 0 0  0 0 0 0 0
EX2:
Код:
2 3 Room Luxury 250000 0 0 The State
3 0 0 0  0 0 0 0 0
How can i fix this?
Reply
#2

Fixed.
Reply


Forum Jump:


Users browsing this thread: