D
deltaquattro
Hi,
thanks to your suggestions I got "Accelerated C++" and I'm studying
it. I found very interesting the possibility of initializing constants
at runtime, but it looks like I'm not getting it right:
#include <iostream>
#include <string>
int main ()
{
std::string name;
const std::string store = name;
std::cout << "Gimme a name " << std::endl;
std::cin >> name;
std::cout << "You wrote " << name << std::endl;
std::cout << "Store was set to " << store;
return 0;
}
The output is:
Gimme a name
Tom
You wrote Tom
Store was set to
What happened to the content of store? Thanks,
greetings,
deltaquattro
thanks to your suggestions I got "Accelerated C++" and I'm studying
it. I found very interesting the possibility of initializing constants
at runtime, but it looks like I'm not getting it right:
#include <iostream>
#include <string>
int main ()
{
std::string name;
const std::string store = name;
std::cout << "Gimme a name " << std::endl;
std::cin >> name;
std::cout << "You wrote " << name << std::endl;
std::cout << "Store was set to " << store;
return 0;
}
The output is:
Gimme a name
Tom
You wrote Tom
Store was set to
What happened to the content of store? Thanks,
greetings,
deltaquattro