16.09.2010, 15:10
(
Последний раз редактировалось Cameltoe; 17.09.2010 в 15:38.
)
- SScanf FTW!
Today, i discovered the efficiency of sscanf.
Try that example and you will see what i mean .
I made this thread to get help about this topic, solved it myself and decided to show an example of it.
Hope someone does take advantage of this.
- Indeed
Today, i discovered the efficiency of sscanf.
pawn Код:
// Heres the enum of random shit.
enum SScanfData {
SScanfString[128],
SScanfInteger,
Float:SScanfFloat,
SScanfDimension[4]
}
new SScanf[MAX_PLAYERS][SScanfData];
// Heres the actual function
function SScanfTest()
{
for(new i; i < 1; i++)
{
sscanf("SScanf is an great way to work with strings, right now i'm trying to make an string exact 128 characters long lets go further!§\
13376335§1337.13371337§1§3§3§7","p<§>e<s[128]ifiiii>",SScanf[i]);
printf("SScanfString: %s",SScanf[i][SScanfString]);
printf("SScanfInteger: %i",SScanf[i][SScanfInteger]);
printf("SScanfFloat: %f",SScanf[i][SScanfFloat]);
printf("SScanfDimension: %i",SScanf[i][SScanfDimension][0]);
printf("SScanfDimension: %i",SScanf[i][SScanfDimension][1]);
printf("SScanfDimension: %i",SScanf[i][SScanfDimension][2]);
printf("SScanfDimension: %i",SScanf[i][SScanfDimension][3]);
}
}
I made this thread to get help about this topic, solved it myself and decided to show an example of it.
Hope someone does take advantage of this.
- Indeed