[Ask] String[] ?
A:
PHP Code:
B: PHP Code:
Correct me if i am wrong :) |
Re: [Ask] String[] ?
I honestly don't know what the default dimension is for arrays when not properly indexed when created but I highly recommend that you ALWAYS define the size of the array explicitly.
|
Re: [Ask] String[] ?
So A is better
|
Re: [Ask] String[] ?
Quote:
|
Re: [Ask] String[] ?
|
Re: [Ask] String[] ?
Quote:
Code:
error 009: invalid array size (negative or zero) |
Re: [Ask] String[] ?
Quote:
|
Re: [Ask] String[] ?
Quote:
|
Re: [Ask] String[] ?
decl String:szName[] = "SmileY";
>> Create a String with char size For sourcemod, for amxmodx do not have decl ?? EDIT: new szName[] = "SmileY"; worked, but i do not know if it is a correct way, i think was created with a maximum lenght of 7 chars |
Re: [Ask] String[] ?
Quote:
server_print("Size of szName: %d", sizeof szName); But yes, 6 chars + 1 null. |
| All times are GMT -4. The time now is 05:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.