Menu

Very new...dont understand why it wont compil

2003-03-27
2012-09-26
  • Alex Alpert

    Alex Alpert - 2003-03-27

    I am at the very beginning of programming (Took some free tutorials so i know very little to programming and i started a small program for a game i play. As i started and when i was done for the small amount of time i had i wanted to compile it and test it to see if what i had so far worked...and ofcourse since im a beginner it didnt work and i dont know why. Here is what i have so far.

    #include <iostream> // I am not sure if these
    #include <iomanip> // 3 files our needed
    #include <cstdio> // to run program (This is not full program)

    int main () {
    int calc_choice;
    using namespace std;
       cout << "Welcome to Azbac's program of Everquest Calculators!" << ;
       cout << "All results are an average from information i have found" << ;
       cout << "And may not be 100% Correct" << ;
       cout << "                                                        " << ;
       cout << "********************************************************" << ;
       cout << "                                                        " << ;
       cout << "For Mana Calculator type " << "1 " << "followd by enter" ;
       cout << "For Haste/Delay Calculator type " << "2 " << "followd by enter" ;
       cout << "Choice: " ;
       cin >> calc_choice  ;

    return 0;
               }

    Thats it. What i want it to do (from what i have so far) is display all that text in " "s and let them select 1 or 2. Selecting 1 or 2 sets the value for the variable calc_choice. Since i do not have much so far can you just tell me whats wrong with it or write me a new one (Since what im asking for so far is very short). Any help is greatly appreciated. Thanks

     
    • Alex Alpert

      Alex Alpert - 2003-03-27

      Oh, and here is a the compile log if its needed:

      Compiler: Default compiler
      Executing  g++.exe...
      g++.exe "C:\Temp\azbac.cpp" -o "C:\Temp\azbac.exe"   -g3  -I"C:\Dev-Cpp\include\c++"  -I"C:\Dev-Cpp\include\c++\mingw32"  -I"C:\Dev-Cpp\include\c++\backward"  -I"C:\Dev-Cpp\include"   -L"C:\Dev-Cpp\lib"
      C:/Temp/azbac.cpp: In function `int main()':
      C:/Temp/azbac.cpp:8: parse error before `;' token

      C:/Temp/azbac.cpp:9: parse error before `;' token

      C:/Temp/azbac.cpp:10: parse error before `;' token

      C:/Temp/azbac.cpp:11: parse error before `;' token

      C:/Temp/azbac.cpp:12: parse error before `;' token

      C:/Temp/azbac.cpp:13: parse error before `;' token

      Execution terminated

       
    • Curtis Sutter

      Curtis Sutter - 2003-03-27

      #include <iostream> // I am not sure if these
      #include <iomanip> // 3 files our needed
      #include <cstdio> // to run program (This is not full program)
      using namespace std; // CLS needed to avoid std::cout and std::cin

      int main ()
      {
      int calc_choice;
      using namespace std;
      cout << "Welcome to Azbac's program of Everquest Calculators!\n"; // CLS you had << ; that is a no-no
      cout << "All results are an average from information i have found\n"; // CLS use either '\n' or "\n" or endl
      cout << "And may not be 100% Correct\n"; // CLS for new-line...
      cout << endl;
      cout << "********************************************************\n";
      cout << endl;
      cout << "For Mana Calculator type " << "1 " << "followed by enter\n";
      cout << "For Haste/Delay Calculator type " << "2 " << "followd by enter\n";
      cout << "Choice: ";
      cin >> calc_choice ;

      return 0;
      }

      Curtis

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.