Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Scorpiorus on Sun 23/11/2003 12:44:04

Title: A note about strings declaration
Post by: Scorpiorus on Sun 23/11/2003 12:44:04
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
Title: Re:A note about strings declaration
Post by: Pumaman on Sun 23/11/2003 17:29:44
Well spotted, the compiler shouldn't allow this. I'll get it fixed.