Thread: Please help, im new to C++ and im getting errors

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    Quote Originally Posted by Tiffany_DD View Post
    okay i fixed everything now it has yet another error

    cpp(103) : error C4716: 'Introscreen' : must return a value
    yup, you missed the return 0;
    Code:
    int Introscreen()
    {
            cout<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"<< endl;
            cout<<"!                                      !"<<endl;
            cout<<"!                                      !"<<endl;
            cout<<"!             Ice and Dice             !"<<endl;
            cout<<"!                                      !"<<endl;
            cout<<"!                                      !"<<endl;
            cout<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"<<endl<<endl;
            cout<<endl;
    
            cout<<"Game details:"<<endl;
            cout<<"The name is in the game, and the game is in the name."<<endl;
            cout<<"and the name of the game is Polar Bears Around An Ice Hole."<<endl;
            cout<<"Some people call this Petals Around A Rose."<<endl<<endl;
            cout<<endl;
            cout<<"Wish to play? Please enter your name here:"<<endl;
            cin>>NAME;
    
    return 0;
    }
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    5
    well.....good news.....i got the program to open....

    really bad news....
    when it opends it shows intro screen and asks the person there name... after i type in a name and hit enter the intro screen pops up again.... it doesnt move on to the next thing

    any ideahs?

  3. #3
    بابلی ریکا Masterx's Avatar
    Join Date
    Nov 2007
    Location
    Somewhere nearby,Who Cares?
    Posts
    497
    Quote Originally Posted by Tiffany_DD View Post
    well.....good news.....i got the program to open....

    really bad news....
    when it opends it shows intro screen and asks the person there name... after i type in a name and hit enter the intro screen pops up again.... it doesnt move on to the next thing

    any ideahs?
    i believe i told you that. here #8
    at line 29


    Code:
     while (PLAYAGAIN == "yes")
    you must place the rest of the codes inside a brace! if you dont do that! you will always get that intro screen!
    why dont you use my revised code! ? i told you how to get rid of that bug! and i myself corrected the program!(as much as i could, dont know about your progs other logic errors,just test your prog yourself) just copy and past the last code i posted! to be more precise i mean this post #10 .
    this should do it ! please before reading posts hastily pay a careful attention to them. thats all , just observe the code i postet , think about it , if you have any problem afterwards , just post , im sure the site professionals will definitely help you ,and by the way it is good to verify my sayings! ( after all im just a newbie too)
    Last edited by Masterx; 05-02-2009 at 08:50 AM.
    Highlight Your Codes
    The Boost C++ Libraries (online Reference)

    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.."
    Bill Bryson


Popular pages Recent additions subscribe to a feed