A note about strings declaration

Started by Scorpiorus, Sun 23/11/2003 12:44:04

Previous topic - Next topic

Scorpiorus

Normally, it's impossible to assign to strings:

string str;
str = "hello world";

But making "initialization" would break that rule:

string str = "hello world";
str = "re-reference";


Compiler doesn't say anything!

At first I thought it's really how you can initialize a string (string s ="...";) but then I realized (trying to initialize the string outside the function) it's nothing like that but a waste of memory.

Chris?


~Cheers

Pumaman

Well spotted, the compiler shouldn't allow this. I'll get it fixed.

SMF spam blocked by CleanTalk