sscanf2 array of strings help.
#1

PHP код:
new var[MAX_PLAYERS][10][32];
new 
var2[MAX_PLAYERS][10];
public 
OnGameModeInit()
{
    
SetGameModeText("Blank Script");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    new 
var3[256];
    
format(var3256"None,None,None,None,None,None,None,None,None,None,3,4,1,3,5,0,0,4,6,0");
    
sscanf(var3"p<,>a<s[4]>[10]a<i>[10]", var[0], var2[0]);
    for(new 
=i<10;i++)
        
printf("var %d = %s, %d"i, var[0][i], var2[0][i]);
    return 
1;

The code above would not insert the strings into the array, it will just remain empty. But if I replace the sscanf to
PHP код:
p<,>a<s[600]>[10]a<i>[10
It would work with the 600 as expected length of string.
Can somebody explain it to me?
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
"None" is 4 characters, but you forgot the NULL.
Actually I tried even 10 as string length, did not work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)