Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

fffffffffffffuuuuuuck c++

Name: Anonymous 2009-09-29 21:30

I'm getting this
fatal error C1004: unexpected end-of-file found
error and I've checked all of my brackets. What else could be the problem?

Name: Anonymous 2009-09-29 21:35

i don't know what C1004 is, and i don't know sepples.
but in C it could be a lot of things. make sure to check your parenthesis and semi-colons too.

Name: Anonymous 2009-09-29 21:39

WE ARE NOT PSYCHICS. WE CAN'T HELP YOU IF YOU DON'T POST CODE.

ANYWAY, YOU PROBABLY FORGOT A ``;'' AFTER A CLASS {};

Name: Anonymous 2009-09-29 21:45

I don't think you want me to post the whole thing...

Name: Anonymous 2009-09-29 21:47

try using a compiler that gives you more descriptive error messages

Name: Anonymous 2009-09-29 21:50

Try using a decent language.

Name: Anonymous 2009-09-29 22:03

>>4
1. LOOK AT YOUR COMPILER
2. FIND THE PROBLEMATIC FILE
3. PASTE THE CODE OF THE FILE

IF YOU DON'T CODE LIKE AN IDIOT (YOU PROBABLY DO, SINCE YOU'RE ASKING IDIOTIC QUESTIONS), YOU SHOULD BE ABLE TO PASTE IT ALL HERE.

Name: Anonymous 2009-09-29 22:03

alright fine i'll post it... here comes the ridicule

Name: Anonymous 2009-09-29 22:04

#include <cstdlib>
#include <iostream>
#include <string>
// random stats should be 8-25
using namespace std;
   int hall = 0;
   string name;
   int time;
   int money;
   int intelligence;
   int Highscore[10];
   class main
      
   {
   void menu()
  
   {
  
  
      int selection = 0;   
    
      cout << "Enter the number for your selection:\n "
       << "1.Start Game\n"
          << "2.High Scores\n"
          << "3.Exit";
         cin >> selection;
      if(selection == 1)
      {
         cout << "Please enter the character's name\n ";
        cin >> name;
        cout << "Welcome to your doom," + name;
        character();
        menu2();
      }
      else if(selection == 2)
      {
      for (int i = 0; int size = 10; i < size; i++)
      {
          cout << Highscore[i] << "\n";
      }
      }
      else if(selection == 3)
      {
          exit(0);
      }
      else
      {
         cout << "Please enter a valid selection.";
         cin >> selection;
      }
      
  
  
    
  
  
   }

    void character()
   {
      int money = (rand()%17)+8;
      int time = (rand()%17)+8;
      int intelligence = (rand()%17)+8;
      int hall = 0;
      bool win = false;
    
   }
  
    void ScoreBoard()
   {
     
      int max;
  
      for (int i = 1; i <= 10; i++)
      {
         if (Highscore[i] > max)
         {
            max = Highscore[i];
         }
      }
     
   }
  void menu2()
  {
      
      if(hall == 20)
      {
        menu4();
      }
       if ((money <= 0) || (time <= 0) || (intelligence <= 0))
       {menu3();
       }
     
     
   
     
      cout <<  name + "You have " + 20 - hall + "steps to go.\n"
           << "1. Move foward (sorry, you can't turn back now)\n"
           << "2. View character\n"
           << "3. Read technical papers\n"
           << "4. Search for loose change\n"
           << "5. Quit the game\n"
           << "Enter your selection:";
      cin  >> selection;
     
      if(selection == 1)
      {
         Encounters();
      }
      else if(selection == 2)
      {
          cout << "Time = " + time + "\n"
               << "Money = " + money + "\n"
               << "Intelligence = " + intelligence + "\n";
        menu2();
      }
      else if(selection == 3)
      {
        cout << " You lose " +randtime + " time\n"
             << " but gain " + randint + " intelligence.";
        menu2();
      }
      else if (selection == 4)
      {
         cout << " You lose " + randtime + " time\n"
              << " but gain " + randmoney + " money.";
         menu2();
      }
      else if (selection == 5)
      { exit(0);
      }
      else
      {
         cout << "Please enter a valid selection.";
         cin >> selection;
      }
      

  
  }
  void menu3()
  { cout <<"\a You have died\n"
         << " Your score only records if you win. Sorry.\n"
         menu();
  }
  void menu4()
  {
      Highscore[1] = time + money + intelligence;
         cout  << "\a You have won!\n"
               << "Time = " + time + "+\n"
               << "Money = " + money + "+\n"
               << "Intelligence = " + intelligence + "+\n"
               << " Equals your score of..." + Highscore[1] + "\n"
          << "Check to see if your score made it in the top 10 list!\n";

            
            menu();
     

  }
  
    void Encounters()
   {
      int chance = (rand()%20 + 1);
      int randtime = (rand()%10);
      int randmoney =(rand()%10);
      int randint  = (rand()%10);
  
  
      if(chance <= 1 )
      {
      //10%
         cout << " You have to grade papers.\n"
         << " You lose " +randtime + " time\n"
         << " but gain " + randmoney + " money.";
         hall++;
         time = time - randtime;
         money = money + randmoney;
         menu2();
      }
      else if (1 < chance <= 6 )
      {
      //25%
         cout << "Nothing happens." << "You lose 1 time.";
         hall++;
         time--;
         menu2();
      }
      else if(6 < chance <= 11)
      {
      //25%
         cout << "You  encounter a puzzle.";
            puzzle(); 
     
      }
      else if(11 < chance <=13 )
      {
      //10%
         cout << " You encounter a professor!"
         << " You lose " + randtime + "time....\n"
         << " but gain " + randint + "intelligence!";
                  
         hall++;
         time = time - randtime;
         intelligence = intelligence +randint;
         menu2();
     
      }
      else if(13 < chance <=16)
      {
         cout << " You are attacked by grunt work!"
         << " You lose " + randtime + " time and\n"
         << + randint + " intelligence.";
         hall++;
         time = time - randtime;
         intelligence = intelligence - randint;
         menu2();
       
      //15%
     
      }
     
     
      else if( 16 < chance <=18)
      {
      //10%
         cout << " You encounter a graduate student.\n"
         << " You lose " + randtime + " time.";
         hall++;
         time = time - randtime;
         menu2();
      }
      else if ( chance >= 19)
      {
         cout << "You found a nickel! Too bad it was glued to the floor..\n"
            << " Lose 1 time trying to pry the nickel off the floor.";
         time--;
         hall++;
         menu2();
      }
    
           
   }
   
   
     
     
   void puzzle()
   {  
       int answer;
       int q =(rand()%5);
       if( q <= 1)
       {
        cout << "How much time do you have left?";
        cin >> answer;
        if ( answer != time)
        {
            cout << "Apparently NONE!";
            menu3();
       }
        else
        { cout << "You gain 1 time!";
        time++;
        hall++;
        menu2();
        }

       }
          if( q == 2)
       {
        cout << "What level COMP class is this?";
        cin >> answer;
        if ( answer != 2710 )
        {
            cout << "You must never come to class...";
            menu3();
       }
        else
        { cout << "You gain 1 time!";
        time++;
        hall++;
        menu2();
        }
        if( q == 3)
        {
            cout << "What is 5 % 4?"
                cin >> answer;
            if (answer != 1)
            {menu3();
            else
            {
cout << "You gain 1 time!";
        time++;
        hall++;
        menu2();
            }
            if (q == 4)
            {
            cout << "What is 4444 - 3107  ?"
                cin >> answer;
            if (answer != 1337)
            {
                menu3();
            }
            else
            {
            cout <<" You gain leet time! (actually just 1, sorry.)";
                time++;
                hall++;
            menu2();

            }
            }
          }
  
   }
          }
      }
   }

Name: Anonymous 2009-09-29 22:07

not OP. just saw disturbing lack of [code] tags
#include <cstdlib>
#include <iostream>
#include <string>
// random stats should be 8-25
using namespace std;
   int hall = 0;
   string name;
   int time;
   int money;
   int intelligence;
   int Highscore[10];
   class main
     
   {
   void menu()
 
   {
 
 
      int selection = 0;  
   
      cout << "Enter the number for your selection:\n "
       << "1.Start Game\n"
          << "2.High Scores\n"
          << "3.Exit";
         cin >> selection;
      if(selection == 1)
      {
         cout << "Please enter the character's name\n ";
        cin >> name;
        cout << "Welcome to your doom," + name;
        character();
        menu2();
      }
      else if(selection == 2)
      {
      for (int i = 0; int size = 10; i < size; i++)
      {
          cout << Highscore[i] << "\n";
      }
      }
      else if(selection == 3)
      {
          exit(0);
      }
      else
      {
         cout << "Please enter a valid selection.";
         cin >> selection;
      }
     
 
 
   
 
 
   }

    void character()
   {
      int money = (rand()%17)+8;
      int time = (rand()%17)+8;
      int intelligence = (rand()%17)+8;
      int hall = 0;
      bool win = false;
   
   }
 
    void ScoreBoard()
   {
    
      int max;
 
      for (int i = 1; i <= 10; i++)
      {
         if (Highscore[i] > max)
         {
            max = Highscore[i];
         }
      }
    
   }
  void menu2()
  {
     
      if(hall == 20)
      {
        menu4();
      }
       if ((money <= 0) || (time <= 0) || (intelligence <= 0))
       {menu3();
       }
    
    
  
    
      cout <<  name + "You have " + 20 - hall + "steps to go.\n"
           << "1. Move foward (sorry, you can't turn back now)\n"
           << "2. View character\n"
           << "3. Read technical papers\n"
           << "4. Search for loose change\n"
           << "5. Quit the game\n"
           << "Enter your selection:";
      cin  >> selection;
    
      if(selection == 1)
      {
         Encounters();
      }
      else if(selection == 2)
      {
          cout << "Time = " + time + "\n"
               << "Money = " + money + "\n"
               << "Intelligence = " + intelligence + "\n";
        menu2();
      }
      else if(selection == 3)
      {
        cout << " You lose " +randtime + " time\n"
             << " but gain " + randint + " intelligence.";
        menu2();
      }
      else if (selection == 4)
      {
         cout << " You lose " + randtime + " time\n"
              << " but gain " + randmoney + " money.";
         menu2();
      }
      else if (selection == 5)
      { exit(0);
      }
      else
      {
         cout << "Please enter a valid selection.";
         cin >> selection;
      }
     

 
  }
  void menu3()
  { cout <<"\a You have died\n"
         << " Your score only records if you win. Sorry.\n"
         menu();
  }
  void menu4()
  {
      Highscore[1] = time + money + intelligence;
         cout  << "\a You have won!\n"
               << "Time = " + time + "+\n"
               << "Money = " + money + "+\n"
               << "Intelligence = " + intelligence + "+\n"
               << " Equals your score of..." + Highscore[1] + "\n"
          << "Check to see if your score made it in the top 10 list!\n";

           
            menu();
    

  }
 
    void Encounters()
   {
      int chance = (rand()%20 + 1);
      int randtime = (rand()%10);
      int randmoney =(rand()%10);
      int randint  = (rand()%10);
 
 
      if(chance <= 1 )
      {
      //10%
         cout << " You have to grade papers.\n"
         << " You lose " +randtime + " time\n"
         << " but gain " + randmoney + " money.";
         hall++;
         time = time - randtime;
         money = money + randmoney;
         menu2();
      }
      else if (1 < chance <= 6 )
      {
      //25%
         cout << "Nothing happens." << "You lose 1 time.";
         hall++;
         time--;
         menu2();
      }
      else if(6 < chance <= 11)
      {
      //25%
         cout << "You  encounter a puzzle.";
            puzzle();
    
      }
      else if(11 < chance <=13 )
      {
      //10%
         cout << " You encounter a professor!"
         << " You lose " + randtime + "time....\n"
         << " but gain " + randint + "intelligence!";
                 
         hall++;
         time = time - randtime;
         intelligence = intelligence +randint;
         menu2();
    
      }
      else if(13 < chance <=16)
      {
         cout << " You are attacked by grunt work!"
         << " You lose " + randtime + " time and\n"
         << + randint + " intelligence.";
         hall++;
         time = time - randtime;
         intelligence = intelligence - randint;
         menu2();
      
      //15%
    
      }
    
    
      else if( 16 < chance <=18)
      {
      //10%
         cout << " You encounter a graduate student.\n"
         << " You lose " + randtime + " time.";
         hall++;
         time = time - randtime;
         menu2();
      }
      else if ( chance >= 19)
      {
         cout << "You found a nickel! Too bad it was glued to the floor..\n"
            << " Lose 1 time trying to pry the nickel off the floor.";
         time--;
         hall++;
         menu2();
      }
   
          
   }
  
  
    
    
   void puzzle()
   { 
       int answer;
       int q =(rand()%5);
       if( q <= 1)
       {
        cout << "How much time do you have left?";
        cin >> answer;
        if ( answer != time)
        {
            cout << "Apparently NONE!";
            menu3();
       }
        else
        { cout << "You gain 1 time!";
        time++;
        hall++;
        menu2();
        }

       }
          if( q == 2)
       {
        cout << "What level COMP class is this?";
        cin >> answer;
        if ( answer != 2710 )
        {
            cout << "You must never come to class...";
            menu3();
       }
        else
        { cout << "You gain 1 time!";
        time++;
        hall++;
        menu2();
        }
        if( q == 3)
        {
            cout << "What is 5 % 4?"
                cin >> answer;
            if (answer != 1)
            {menu3();
            else
            {
cout << "You gain 1 time!";
        time++;
        hall++;
        menu2();
            }
            if (q == 4)
            {
            cout << "What is 4444 - 3107  ?"
                cin >> answer;
            if (answer != 1337)
            {
                menu3();
            }
            else
            {
            cout <<" You gain leet time! (actually just 1, sorry.)";
                time++;
                hall++;
            menu2();

            }
            }
          }
 
   }
          }
      }
   }

Name: Anonymous 2009-09-29 22:10

>>9
TERRIBLE!

BUT ANYWAY, SEE >>3. THAT'S YOUR PROBLEM.

Name: Anonymous 2009-09-29 22:12

class main

THIS IS NOT JAVA YOU DO NOT BELONG THERE

Name: Anonymous 2009-09-29 22:12

ALSO, HOLY SHIT YOUR BRACKETS ARE A COMPLETE MESS. I'M NOT GONNA BOTHER COUNTING THEM, BUT ODDS ARE THAT YOU PROBABLY FORGOT ONE SOMEWHERE.

Name: Anonymous 2009-09-29 22:15

brackets arent the problem.
Why doesn't class main go there?

Name: Anonymous 2009-09-29 22:36

Do I not need the
class main?
what should go there instead? Nothing?

Name: Anonymous 2009-09-29 23:12



ALRIGHT I FIGURED THE PREVIOUS ERROR OUT AND IT COMPILES BUT IT WON'T RUN NOW DUE TO THIS ERROR PLZ HALP

1>LINK : fatal error LNK1561: entry point must be defined

Name: Anonymous 2009-09-29 23:23

if (answer != 1){
    menu3();
    else
    {

This is one thing that's causing a problem.

Also the very last bracket requires a semicolon after it.

Name: Anonymous 2009-09-29 23:35

yeah I fixed that, and it compiles now.
When I try to run it however, it says this
1>LINK : fatal error LNK1561: entry point must be defined

Name: Anonymous 2009-09-30 1:03

lul'd at the "class main", that shit is hilarious. your linker error is probably because you didn't implement WinMain(). java is that way -->

Name: Anonymous 2009-09-30 1:13

And people say forced indentation of code is a bad thing...

Name: Anonymous 2009-09-30 1:32

Fuck. Off.

Name: Anonymous 2009-10-01 8:21

for (int i = 0; int size = 10; i < size; i++)

BRILLIANT!!!

Name: Anonymous 2009-10-01 8:24

>>9
Shit... shit. I'm speechless.

Name: Anonymous 2009-10-01 8:27

>>23
No, you're witless.

Name: Anonymous 2009-10-01 8:28

>>24
I am not an anus!

Name: Anonymous 2009-10-01 9:33

>>22
Imagine what this poster could do with TeX

Name: Anonymous 2009-10-01 10:00

>>1
Some C/C++ compilers require that a file ends with a newline.

Name: Anonymous 2009-10-01 11:18

>>27
It's part of the standard IIRC.

Name: Anonymous 2009-10-01 12:59

>>1,8,9,14-16,18
Get out of programming, now.

Name: Anonymous 2009-10-01 16:10

            }
            }
          }
 
   }
          }
      }
   }
What is this, Lisp?
Also, use pastebin, faggot.

Name: Anonymous 2009-10-03 18:03

Brilliant!

Name: Anonymous 2009-10-03 18:25

Now you are programming with ENTERPRISE!!!!!

Name: Anonymous 2009-10-03 18:55

my anus is ENTERPRISE!!!

Name: Anonymous 2009-10-03 19:09

I suggest you read Structure and Implementation of Child Pornography, How to Double Penetrate or Yet Another Haskell Troll.

Name: Anonymous 2009-10-03 19:10

interpretation

Name: Anonymous 2009-10-03 22:55

Nobody is going to want to help you when you can't indent your code worth a damn.. second, check your parenthesis and brackets.If you indented correctly you could see whether they did or did not match up easily.

Name: Anonymous 2009-10-05 16:27

there is so much wrong with this code;

half these variables you didn't even declare;

i tried to fix it for you but got damb.

Name: Anonymous 2009-10-05 16:37

#include <cstdlib>
#include <iostream>
#include <string>
// random stats should be 8-25
using namespace std;
int hall = 0;
string name;
int time;
int money;
int intelligence;
int Highscore[10];
bool win = false;
class main {
        void menu() {
            int selection = 0;
            cout << "Enter the number for your selection:\n " << "1.Start Game\n" << "2.High Scores\n" << "3.Exit";
            cin >> selection;
            if (selection == 1) {
                cout << "Please enter the character's name\n ";
                cin >> name;
                cout << "Welcome to your doom," + name;
                character();
                menu2();
            } else if (selection == 2) {
                int size = 10;
                for (int i = 0; i < size; i++) {
                    cout << Highscore[i] << "\n";
                }
            } else if (selection == 3) {
                exit(0);
            } else {
                cout << "Please enter a valid selection.";
                cin >> selection;
            }
        }

        void character() {
            money = (rand() % 17) + 8;
            time = (rand() % 17) + 8;
            intelligence = (rand() % 17) + 8;
            hall = 0;
            win = false;
        }

        void ScoreBoard() {
            int max;
            for (int i = 1; i <= 10; i++) {
                if (Highscore[i] > max) {
                    max = Highscore[i];
                }
            }
        }

        void menu2() {
            if (hall == 20) {
                menu4();
            }
            if ((money <= 0) || (time <= 0) || (intelligence <= 0)) {
                menu3();
            }

            int selection;
            cout << name << "You have " << (20 - hall) << "steps to go.\n";
            cout << "1. Move foward (sorry, you can't turn back now)\n";
            cout << "2. View character\n";
            cout << "3. Read technical papers\n";
            cout << "4. Search for loose change\n";
            cout << "5. Quit the game\n";
            cout << "Enter your selection:";
            cin >> selection;

            int randtime = (rand() % 10);
            int randmoney = (rand() % 10);
            int randint = (rand() % 10);
            if (selection == 1) {
                Encounters();
            } else if (selection == 2) {
                cout << "Time = " << time << "\n" << "Money = " << money << "\n" << "Intelligence = " << intelligence << "\n";
                menu2();
            } else if (selection == 3) {
                cout << " You lose " << randtime << " time\n" << " but gain " << randint << " intelligence.";
                menu2();
            } else if (selection == 4) {
                cout << " You lose " << randtime << " time\n" << " but gain " << randmoney << " money.";
                menu2();
            } else if (selection == 5) {
                exit(0);
            } else {
                cout << "Please enter a valid selection.";
                cin >> selection;
            }

        }
        void menu3() {
            cout << "\a You have died\n" << " Your score only records if you win. Sorry.\n";
            menu();
        }
        void menu4() {
            Highscore[1] = time + money + intelligence;
            cout << "\a You have won!\n" << "Time = " << time << "+\n" << "Money = " << money << "+\n" << "Intelligence = " << intelligence << "+\n";
            cout << " Equals your score of..." << Highscore[1] << "\n" << "Check to see if your score made it in the top 10 list!\n";

            menu();

        }

        void Encounters() {
            int chance = (rand() % 20 + 1);
            int randtime = (rand() % 10);
            int randmoney = (rand() % 10);
            int randint = (rand() % 10);

            if (chance <= 1) {
                //10%
                cout << " You have to grade papers.\n" << " You lose " << randtime << " time\n" << " but gain " << randmoney << " money.";
                hall++;
                time = time - randtime;
                money = money + randmoney;
                menu2();
            } else if (chance <= 6) {
                //25%
                cout << "Nothing happens." << "You lose 1 time.";
                hall++;
                time--;
                menu2();
            } else if (chance <= 11) {
                //25%
                cout << "You  encounter a puzzle.";
                puzzle();
            } else if (chance <= 13) {
                //10%
                cout << " You encounter a professor!" << " You lose " << randtime << "time....\n" << " but gain " << randint << "intelligence!";
                hall++;
                time = time - randtime;
                intelligence = intelligence + randint;
                menu2();
            } else if (chance <= 16) {
                //15%
                cout << " You are attacked by grunt work!" << " You lose " << randtime << " time and\n" << randint << " intelligence.";
                hall++;
                time = time - randtime;
                intelligence = intelligence - randint;
                menu2();
            } else if (chance <= 18) {
                //10%
                cout << " You encounter a graduate student.\n" << " You lose " << randtime << " time.";
                hall++;
                time = time - randtime;
                menu2();
            } else if (chance >= 19) {
                cout << "You found a nickel! Too bad it was glued to the floor..\n" << " Lose 1 time trying to pry the nickel off the floor.";
                time--;
                hall++;
                menu2();
            }
        }

        void puzzle() {
            int answer;
            int q = (rand() % 5);
            if (q <= 1) {
                cout << "How much time do you have left?";
                cin >> answer;
                if (answer != time) {
                    cout << "Apparently NONE!";
                    menu3();
                } else {
                    cout << "You gain 1 time!";
                    time++;
                    hall++;
                    menu2();
                }
            }
            if (q == 2) {
                cout << "What level COMP class is this?";
                cin >> answer;
                if (answer != 2710) {
                    cout << "You must never come to class...";
                    menu3();
                } else {
                    cout << "You gain 1 time!";
                    time++;
                    hall++;
                    menu2();
                }
                if (q == 3) {
                    cout << "What is 5 % 4?";
                    cin >> answer;
                    if (answer != 1) {
                        menu3();
                    } else {
                        cout << "You gain 1 time!";
                        time++;
                        hall++;
                        menu2();
                    }
                    if (q == 4) {
                        cout << "What is 4444 - 3107  ?";
                        cin >> answer;
                        if (answer != 1337) {
                            menu3();
                        } else {
                            cout << " You gain leet time! (actually just 1, sorry.)";
                            time++;
                            hall++;
                            menu2();
                        }
                    }
                }
            }
        }
};


i fixed it up a little bit; but it is still tragic what you are doing. it will not function as you expect it to.

Name: Anonymous 2009-10-05 19:22

OP is trolling.  No one writes that much code without compiling it to see if it's working along the way.

Name: Anonymous 2009-10-05 21:23

Holy fuck OP did you teach yourself programming by reading the first link that Google gave you?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List