Welcome to Dream.In.Code
Become a C++ Expert!

Join 150,064 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,770 people online right now. Registration is fast and FREE... Join Now!




Changing text in a console application

 
Reply to this topicStart new topic

Changing text in a console application

c--
1 Feb, 2008 - 06:23 PM
Post #1

New D.I.C Head
*

Joined: 26 Jan, 2008
Posts: 27

Is there any way to change text of a console program?

Like, a game, changing the score...
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Changing Text In A Console Application
1 Feb, 2008 - 07:47 PM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,355



Thanked: 51 times
Dream Kudos: 25
My Contributions
yes there is...it depends how you want to do it. Do you have access to the source code?
User is offlineProfile CardPM
+Quote Post

c--
RE: Changing Text In A Console Application
1 Feb, 2008 - 08:03 PM
Post #3

New D.I.C Head
*

Joined: 26 Jan, 2008
Posts: 27

QUOTE(c-- @ 1 Feb, 2008 - 07:23 PM) *

Is there any way to change text of a console program?

Like, a game, changing the score...


Hm, I'm currently writing the game, well, it's my first game. I don't have it done already.
But do you think you can help me with this example? smile.gif

CODE

#include <iostream>

using std::cout;
using std::cin;
using std::endl;

int num;
int score = 0;

int main()
{

//This text should be changed everytime the user earn new points...
cout <<"Score: " << score << "\n\n";

cout << "Choose the correct number" << endl << endl;

    cout << "9, 7, 3";
    cout << endl << endl;


        cin >> num;

        if (num == 9)
        score++;
        else
        cout << "\n\nWrong number";

        

    cin.ignore();
    cin.get();
}


This post has been edited by c--: 1 Feb, 2008 - 08:03 PM
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 10:46PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month