Actual size of array.
Hello,
Yesterday I started with Amx Mod X and Pawn language. Let's say that IP in this array is 192.168.1.1 in below example: Code:
new szIP[128];Sizeof returns 128, but I'm looking for 11, because "192.168.1.1" == 11. PS. Sorry for my weak english. |
Re: Actual size of array.
new szIP[128]
-> new szIP[11] |
Re: Actual size of array.
Quote:
192.168.1.1 was only an example. |
Re: Actual size of array.
Then make it big enough and use szIP[0] to get the whole array.
|
Re: Actual size of array.
Thanks for help.
T/C. Problem solved. |
Re: Actual size of array.
Quote:
To get the current size of the string, use strlen( ). |
Re: Actual size of array.
Aaaaah, whooops, just write it as it is to get the whole array, sorry. :D
|
Re: Actual size of array.
Quote:
|
Re: Actual size of array.
In fact, you should do
PHP Code:
|
Re: Actual size of array.
I did it this way:
PHP Code:
|
| All times are GMT -4. The time now is 16:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.