Namespace

This is a discussion on Namespace within the C++ Programming forums, part of the General Programming Boards category; I am using Borland C++ 5.02 and my operating system is Windows 2000. Im having trouble compiling the following code:- ...

  1. #1
    Wannabe Geek
    Join Date
    Aug 2004
    Posts
    19

    Question Namespace

    I am using Borland C++ 5.02 and my operating system is Windows 2000.
    Im having trouble compiling the following code:-
    Code:
    #include <iostream> 
    using namespace std;
    int main()
    {
           cout << "Hello World";
           return 0;
    }
    It however compiles in gcc.
    What is wrong with the code displayed above? Why does it not compile in Borland C++ 5.02?
    Thanx in Advance.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,445
    Could be that Borland C++ 5.02 is outdated and does not implement namespaces (correctly).
    Just search the Web and you'll probably get a clearer answer.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    > Why does it not compile in Borland C++ 5.02?
    Why didn't you post the error message you got?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. extern namespace?
    By Brafil in forum C++ Programming
    Replies: 2
    Last Post: 01-10-2009, 07:06 AM
  2. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. data validation & namespace
    By tiange in forum C++ Programming
    Replies: 4
    Last Post: 07-05-2005, 02:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21