• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is Xcode C++ non-standard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is Xcode C++ non-standard?


  • Subject: Re: Is Xcode C++ non-standard?
  • From: Jim Ingham <email@hidden>
  • Date: Tue, 28 Sep 2004 17:03:51 -0700

The C++ standard actually requires that the standard iostream commands (and everything else from the standard C++ library) NOT be in the global namespace. If you want to refer to the stuff in std:: without the prefix, you need to say "using std".

You can also do:

#include <iostream.h>

if you want to get the "old fashioned" behavior, where the standard C++ library functions are in the global namespace. That just #include's iostream, then issues a whole bunch of "using" directives.

Jim



On Sep 28, 2004, at 4:50 PM, Bert Knabe wrote:

I took a class in C++ years ago, and since OS X has built in programming tools and I have a couple of books on C++ I would like to start learning again. But there is one small problem that I hope can be easily fixed. In order to use what I thought were standard iostream commands, for example cin and cout, I have to prepend them with 'std::' or I get an error. Is there something I need to add or include besides iostream? Do I need to get libstdc++?

Thanks for any help,

Bert Knabe
Computer Technician
Lubbock Avalanche Journal
(806) 766-2158

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Is Xcode C++ non-standard? (From: Bert Knabe <email@hidden>)

  • Prev by Date: Re: Is Xcode C++ non-standard?
  • Next by Date: Re: spreadsheets...NSTableView...?java?
  • Previous by thread: Re: Is Xcode C++ non-standard?
  • Next by thread: spreadsheets...NSTableView...?java?
  • Index(es):
    • Date
    • Thread