Results 1 to 4 of 4

Thread: problem with c++ (with emacs editor)

  1. #1
    Join Date
    Aug 2011
    Beans
    43

    problem with c++ (with emacs editor)

    i'm trying to make my first program, writing this:


    #include <iostream.h>


    int main();
    {
    cout <<"Hello World!\n";
    return 0;
    }



    and in terminal it says: iostream.h: No such file or directory

    so, i change it, as i've read on this forum:

    #include <iostream> (i erased .h)

    and in terminal it says:
    expected unqualified-id before ‘{’ token


    what can i do about it??
    ps. i'm a total beginner with computing!!

  2. #2
    Join Date
    Feb 2008
    Beans
    5,636

    Re: problem with c++ (with emacs editor)

    It has to be either
    PHP Code:
    #include <iostream>
     
    int main();
     {
     
    using namespace std;
     
    cout <<"Hello World!\n";
     return 
    0;
     } 
    or
    PHP Code:
    #include <iostream>
     
    int main();
     {
     
    std::cout <<"Hello World!\n";
     return 
    0;
     } 

  3. #3
    Join Date
    Aug 2011
    Beans
    43

    Re: problem with c++ (with emacs editor)

    thanksss!

  4. #4
    Join Date
    Feb 2008
    Beans
    5,636

    Re: problem with c++ (with emacs editor)

    You're welcome and don't forget to mark the thread as solved.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •