Array to string
#9

Doing this
pawn Код:
new Input = {'a','b','c','d','e'};
print(Input);
Isn't possible, because this , is supposed to hold an integer generally but doing this is possible:
pawn Код:
new Input[6] = {'a','b','c','d','e'};
print(Input);//would print 'abcde'
//tests:
for(new i = 0; i <6; i++) printf("%d:%s",i,Input);
/*
Would Print:
0:a
1:b
2:c
3:d
4:e
5: ' '//Means an empty message because the fifth cell is for the \0 , the null character
*/
Reply


Messages In This Thread
Array to string - by Sickae - 01.04.2015, 16:19
Re: Array to string - by CalvinC - 01.04.2015, 16:41
Re: Array to string - by Sickae - 01.04.2015, 16:49
Re: Array to string - by iggy1 - 01.04.2015, 16:53
Re: Array to string - by admantis - 01.04.2015, 16:56
Respuesta: Array to string - by alexus - 01.04.2015, 17:02
Re: Respuesta: Array to string - by Yashas - 01.04.2015, 17:12
Re: Array to string - by CalvinC - 01.04.2015, 17:20
Re : Array to string - by nicolaskettler - 01.04.2015, 17:38
Re: Respuesta: Array to string - by Sickae - 01.04.2015, 18:15

Forum Jump:


Users browsing this thread: 4 Guest(s)