16.01.2011, 14:03
Hy, i am trying to retrieve multiple info from a string with sscanf.
Here's my code:
And this is what i get in console:
EX1:
EX2:
How can i fix this?
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]);
EX1:
Код:
1 8 Room Luxury 625000 0 0 The State 8 0 0 0 0 0 0 0 0
Код:
2 3 Room Luxury 250000 0 0 The State 3 0 0 0 0 0 0 0 0