I need help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Oneal
    New Member
    • Nov 2006
    • 4

    #1

    I need help

    hello everyone, am new to programming though i got a book tht am reading 4 d c++ but anytime i write my program and about compiling it, it will be tell me tht invalid token,expected unqualified-id b/4 numeric constant srry wt is d meaning of tht.i will appreciate if anybody can assist me on this matter.am using Dev-c++ compiler.
  • topazdemon
    New Member
    • Nov 2006
    • 8

    #2
    how about posting d code dat gives u d error. Then I will probably be able to help you a little more. don't forget code tags.

    Comment

    • Oneal
      New Member
      • Nov 2006
      • 4

      #3
      Thanks. I really appreciate your concern.here is it.i will be expecting your reply soon.

      1: #include <iostream.h>
      2:
      3: int main()
      4: {
      5: cout << "Hello World!\n";
      6: return 0;
      7: }

      Comment

      • sonic
        New Member
        • Nov 2006
        • 40

        #4
        Code:
         #include <iostream.h>
         int main()
         {
            cout << "Hello World!\n";
                return 0;
         }
        Don't know if this will help, but try taking the ".h" off of the iostream predirective. Instead maybe:

        #include <iostream>

        Comment

        • Ganon11
          Recognized Expert Specialist
          • Oct 2006
          • 3651

          #5
          Also, include this line directly after your #include statement:

          Code:
          using namespace std;
          Or, instead of cout, use

          Code:
          std::cout << "Hello World!\n";

          Comment

          • Oneal
            New Member
            • Nov 2006
            • 4

            #6
            Great,but what name and file extension should i use in saving it in the library.

            Comment

            • sonic
              New Member
              • Nov 2006
              • 40

              #7
              .cpp, I think....

              Comment

              • momotaro
                Contributor
                • Sep 2006
                • 357

                #8
                its for example hello_world.cpp
                but i don't understand why you wanna save it to the "library" !

                Comment

                Working...