How to select string?

So if i have several strings and want to select one to display, how do i do that? (code below)

#include <iostream>
#include <fstream>
using namespace std;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
int main(){
    cout << "blahblah";
    string a="blahblah";
    string b="blahblah";
    string c="blahblah";
    string d="blahblah";
    string e="blahblah";
    string f="blahblah";
    string choice;//selects which string to display (cout)
    cin >> whichone;
    cout << //?
    cout <<endl<<"blahblah\n";
    system("PAUSE");
}
I don't understand the question.

11. cout << e;

is this what you want?
I am wanting the user to enter which string and then display that particular string
Last edited on
Oh, come on, people. It's just a switch statement (or if-else chain) that he wants.
http://cplusplus.com/doc/tutorial/control/#switch

-Albatross
Topic archived. No new replies allowed.