Re: [Dev-C++] How would you write a method returning a string ?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: matheus r. <mfr...@gm...> - 2007-07-22 15:45:42
|
> std::string& NameSpace::ClassName::MethodName(const char* var){return
> someString = var;}
Not a good idea if somestring is a function variable. It will go out
of scope and be destroyed, returning a ref to it will yield undefined
results.
|