Enums and Arrays
#7

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
Oh ok, I will have to read some things again then.

@PowerPC603: Hm, never tried it with a 0


The problem why you cant use it like this:
pawn Код:
new msg[128];
msg = "Hello";
msg = "";
is caused by the way pawn handles strings.
A String is just a integer-array, with one int for each character. And if you use the normal '=' operator, pawn tries to write a string (array, e.g. "Hello", length 5) into another array (msg[128]). But as you can see, these both array do not have the same size, so you cant just set the on‌e=the other. This gives you the error then.
Actually you can use it like that. I've used it like that many times and it works and compiles fine with no errors. But I get what you're saying.
Reply


Messages In This Thread
Enums and Arrays - by Th3Angel - 14.02.2011, 20:50
Re: Enums and Arrays - by Mauzen - 14.02.2011, 21:26
Re: Enums and Arrays - by Th3Angel - 14.02.2011, 22:23
Re: Enums and Arrays - by PowerPC603 - 14.02.2011, 22:33
Re: Enums and Arrays - by Th3Angel - 14.02.2011, 22:41
Re: Enums and Arrays - by Mauzen - 14.02.2011, 23:27
Re: Enums and Arrays - by Th3Angel - 14.02.2011, 23:46

Forum Jump:


Users browsing this thread: 2 Guest(s)