25.02.2012, 11:55
Using format to copy strings is horrible. Also that second method would probably give a runtime error, as you're trying to format a string into a destination that is too small too hold the entire string. Whereas if you'd do:
The compiler would throw an error: error 018: initialization data exceeds declared size
The first method just assigns the string "Hello" to the array called test1. At compile time, the compiler will calculate the size of this array and it will be compiled as:
pawn Код:
new test2[5] = "Hello";
The first method just assigns the string "Hello" to the array called test1. At compile time, the compiler will calculate the size of this array and it will be compiled as:
pawn Код:
new test1[6] = "Hello";