next up previous
Next: How do I specify Up: class and struct Previous: How do I write

How do I read from the standard input in a C++ way?

Include iostream and use the operator $ »$. For a string of undefined length, use getline.
float	f;
char	str[255];

std::cin >> f;
std::cin.getline(str, 255);

Alexis Angelidis (PhD) 2005-01-11