How to save text in variable?
#1

Код:
new Text[4]={"Nice"};
How do I save text in same variable later?

if I do this

Код:
Text[4]={"Nice"};
I get

error 032: array index out of bounds
Reply
#2

Quote:
Originally Posted by Supermaxultraswag
Посмотреть сообщение
Код:
new Text[4]={"Nice"};
How do I save text in same variable later?

if I do this

Код:
Text[4]={"Nice"};
I get

error 032: array index out of bounds
You are not leaving a 'slot' for the NULL terminator.

It should be:

PHP код:
new Text[5] = "Nice"
Could also be written as:

PHP код:
new Text[5] = {'N''i''c''e''\0'}; 
Reply
#3

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
You are not leaving a 'slot' for the NULL terminator.

It should be:

PHP код:
new Text[5] = "Nice"
Could also be written as:

PHP код:
new Text[5] = {'N''i''c''e''\0'}; 
I still get the same error
Reply
#4

PHP код:
new Text[5];
Text "Nice"
Reply
#5

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
new Text[5];
Text "Nice"
tHANKS
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)