How do I declare a word-answer-variable?

What command do I use do declare a variable that should collect a word? If i was collecting an integer I would use "int" but what do I use when collecting a word answer?

I want to write a "If Else" program that either convert swedish Kronas to Euro or the other way around...
Last edited on
You could use a string.
Its in the <string> header

1
2
std::string str;
std::cin >> str;


It depemds on how will look a menu of selections. If it will look for example the following way

Euro........1
Krones.....2

Exit.........0

then you can declare an int object that will get user input.
Last edited on
Ok, I'm new to strings...
So I write
#include <string> in the header...
Could you help me som more as to how I use the following commands?
Topic archived. No new replies allowed.