how to count the string size of this?
#1

pawn Код:
//this is to load player info from MySQL
sscanf(string, "p<|>s[24]s[129]s[16]ddddddddddddddddddddddddddddds[30]s[30]s[30]s[30]s[30]ddddddd", String[0].......);
it the size 82?
Reply
#2

Why should you need the length of it?
It's 81 actually.
Reply
#3

Quote:
Originally Posted by Macluawn
Посмотреть сообщение
Why should you need the length of it?
It's 81 actually.
I need the length because im trying to optimize my gm

and 81 dont i have to count with the NULL thing?
and i made a print of the string it retuned something like

Код:
Unknown123 | HASHEDpASSWORDhERE | 192.168.1.1 | INTEGER1 | INTEGER2 | INTEGER3 then so on..
is you sure it is 81? i dont know
Reply
#4

Why should you need to include the null parameter? You're not storing it anywhere.
That one parameter doesn't determine the size of the array where you're going to store returned data from mysql.
Reply
#5

ok, summary
i got this

pawn Код:
new string[81];
sscanf(string, "p<|>s[24]s[129]s[16]ddddddddddddddddddddddddddddds[30]s[30]s[30]s[30]s[30]ddddddd", String[0].......);
mysql_query(string);
so the string size so correct now? the old string i had was over 950
Reply
#6

no.
String should contain the data you want to split, and string size should be the length of returned string.
It should be way more than 81.
If you dont want to post information about every variable or string in your mysql, then you will have to count the maximum size of string yourself. I suggest you not to share that information, so.. goodluck counting.
Reply
#7

ok, thanks you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)