Why does this not work? Simple Text
#6

Yes, you can copy strings like that, under the condition that the number of dimensions is the same and that the size of the array on the left is equal or greater than the size of the array on the right.

pawn Код:
new test1[] = "hello world";
new test2[12];

test2 = test1;
printf("test2 = \"%s\"", test2);
In this particular case, however, the number of dimensions isn't the same so direct assignment does not work.
Reply


Messages In This Thread
Why does this not work? Simple Text - by Phil_Cutcliffe - 20.02.2014, 18:58
Re: Why does this not work? Simple Text - by Konstantinos - 20.02.2014, 19:02
Re: Why does this not work? Simple Text - by MattTucker - 20.02.2014, 19:15
Re: Why does this not work? Simple Text - by Phil_Cutcliffe - 20.02.2014, 19:22
Re: Why does this not work? Simple Text - by Konstantinos - 20.02.2014, 19:27
Re: Why does this not work? Simple Text - by Vince - 20.02.2014, 19:36
Re: Why does this not work? Simple Text - by Phil_Cutcliffe - 20.02.2014, 20:02
Re: Why does this not work? Simple Text - by Phil_Cutcliffe - 21.02.2014, 16:07

Forum Jump:


Users browsing this thread: 2 Guest(s)