window instead of console

Hey guys i wanted to make something like a console but instead of that i wanted to make a window that i could acctually write on it to put something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
int main ()
{
    string bot;
    string tob;
    cout << "What letter is this? >> a" <<endl;
    getline (cin, bot);
    if (bot == "a")
         cout << "YES CORRECT!" << endl;
    else if (bot == "b")
         cout << "hrrrr WRONG WHAT AN IDIOT!" << endl;
    system("pause");
    return 0;
}

(this was on another topic i had)
can someone tell me how i can do something like this but in a window instead of console?
Last edited on
Welcome to the wonderful world of GUI building.

As to your question, it depends on what you want to do and what operating system you want to develop for. If you want to develop for windows, it will be alot easier. Judging by your use of "system("PAUSE")" I am going to assume you are using windows, in which case life will be alot easier for you. If you want to develop for other platforms, such as windows (which is brave of you as it is much harder to learn), then you can use QT, GTK or WxWidgets. They aren't as hard to use as they may seem based on what I've been saying, but they are harder to learn.

Anyway, programming a windows GUI isn't too difficult. There are many tutorials on the internet.

Oh, and by the way, see here http://cplusplus.com/forum/articles/11153/ for why you shouldn't use the system() function.
thanks for the tips and thanks for the system thing i understand why i shouldnt use that now =D
No problem :)
If you ever get stuck doing something in windows, use msdn.microsoft.com - it is one of few things that Microsoft have done really well. Some of the examples are difficult to follow, but mostly they're very good...

Have fun. Perhaps as a first project you could try some buttons and text inputs (something I never got the hang of, unfortunately).
Topic archived. No new replies allowed.