There is no possible way to return a string right? I tried it with no luck with a couple of variations.
1 2 3 4 5 6
|
#include <string>
std::string function(){
std::string Foo;
Foo = "Foo";
return Foo;
}
|
Last edited on
Function main is declared as returning int. Why are you trying to return a string?!
Out of interest, what are you hoping to return the string to?
Andy
Ok Epic facepalm on my part, I was supposed to say string function();
But I wanted to just return a string variable, I just decided to use pointers.
I just wanted to know why you couldn't return a string, it's part of the STL so It should be included Right?
I need to drink more coffee :)
Last edited on