Is this ok ?
#1

Quote:

public LoadStuff()
{
new arrCoords[4][64];
new strFromFile2[256];
new File: file = fopen("stuff.ini", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
Jackpot = strval(arrCoords[0]);
fclose(file);
}
else
{
GameModeExit();
}
return 1;
}

public SaveStuff()
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d", Jackpot);
new File: file2 = fopen("stuff.ini", io_write);
fwrite(file2, coordsstring);
fclose(file2);
return 1;
}

1. Is the code ok ?
2. What will happen if i change new coordsstring[256]; 256 to 128 ? nothing ?
Reply
#2

1 i believe so 2 nothing
Reply
#3

If u change it from 256 to 128 then instead of the maximum letters to be 256, they will be 128
Or, you could simply change it to sizeof(string)
Reply
#4

^^^^@@@@
Reply
#5

^^^^@@@@ wtf ? )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)