Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: C++ hello world

  1. #1
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts

    C++ hello world

    everywhere i look it tells me to use

    Code:
    #include <isostream>
    using namespace std;
    
    int main()
    {
    	cout << "Hello World\n";
    	return 0;
    }
    but when i compile this with boarland c++ compiler, mingw or devc++ they all throwthe following errors (albeit worded slightly differently each time)

    Code:
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    hello.cpp:
    Error E2209 hello.cpp 1: Unable to open include file 'isostream'
    Error E2282 hello.cpp 2: Namespace name expected
    Error E2451 hello.cpp 6: Undefined symbol 'cout' in function main()
    *** 3 errors in Compile ***
    this is the simplest script u can do so how am i getting 3 errors (and how do i fix them)

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    I always thought this line:
    Code:
    #include <isostream>
    should be
    Code:
    #include <iostream>

  • #3
    Regular Coder trib4lmaniac's Avatar
    Join Date
    Feb 2004
    Location
    Cornwall, UK
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Brandoe85
    I always thought this line:
    Code:
    #include <isostream>
    should be
    Code:
    #include <iostream>
    You would be correct.

  • #4
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    i always thought
    Quote Originally Posted by trib4lmaniac
    You would be correct.
    should be
    useful
    but apparently i was wrong

    -----
    thanks, Brandoe85, i just looked at another example in my book and worked out that the 1st 1 had a typo in it but maby you could have said this in a less condescending way than "i always thought ..typo.. shud be... real spelling")

    this whole "Computer Programming" forum better not be like you two

  • #5
    Regular Coder trib4lmaniac's Avatar
    Join Date
    Feb 2004
    Location
    Cornwall, UK
    Posts
    535
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ghell
    this whole "Computer Programming" forum better not be like you two
    Lol, I am unique - just like everybody else

  • #6
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    Quote Originally Posted by ghell
    thanks, Brandoe85, i just looked at another example in my book and worked out that the 1st 1 had a typo in it but maby you could have said this in a less condescending way than "i always thought ..typo.. shud be... real spelling")

    this whole "Computer Programming" forum better not be like you two
    I did not mean it that way, my bad


  •  

    Posting Permissions

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