In function Func(), I'm returning a local variable and the program displays the correct result. I can't figure out why...Code:#include <iostream> #include <string> std::string Func() { std::string linha; std::getline(std::cin, linha); return linha; } int main() { std::string linha; linha = Func(); std::cout << linha << std::endl; }
Thanks.



LinkBack URL
About LinkBacks


