Thread: More qusetions 2 ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    21

    More qusetions 2 ...

    I seem to be asking alot of questions but C++ is fun ! I was wandering how I could get my program to exit whenever 7 is entered and I was wandering about how I would clear the screen when the user wnats to do another calculation.

  2. #2
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    Remember to check the FAQ for your questions
    Here are the answers...
    http://faq.cprogramming.com/cgi-bin/...&id=1043284385
    http://faq.cprogramming.com/cgi-bin/...&id=1043284385

  3. #3
    Banned
    Join Date
    Oct 2004
    Posts
    250
    You could check user imput with a simple if statement and to clear the screen you could use system("cls"); that is if your using windows.

  4. #4
    Attack hamster fuh's Avatar
    Join Date
    Dec 2002
    Posts
    176
    Code:
    if(input == 7) {
    return 0;
    }
    I think people are forgetting about return these days...
    Seems simple enough for me, and that's saying a lot
    Stupid things pop singers say

    "I get to go to lots of overseas places, like Canada."
    - Britney Spears

    "I love what you've done with the place!"
    -Jessica Simpson upon meeting the Secretary of Interior during tour of the White House

  5. #5
    Banned
    Join Date
    Oct 2004
    Posts
    250
    yes main is a int function so it should return a value

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Is there a reason you failed to learn the answers to your questions from your last two posts:

    http://cboard.cprogramming.com/showthread.php?t=62144
    http://cboard.cprogramming.com/showthread.php?t=62128

    And check this out before using cgod's solution:

    http://www.cprogramming.com/tips/sho...ount=30&page=0

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. More qusetions...
    By ComDriver in forum C++ Programming
    Replies: 2
    Last Post: 02-21-2005, 02:56 PM