tags:

views:

1595

answers:

17
A: 

C++ is an ISO standard that costs a lot of money (370 swiss francs, which is about 330 dollar). I don't know about the other, but I suspect it's similar.

Leon Timmermans
A: 

Search Google for this: c89 ansi standard

Etc. Also, there is probably a copy in the back of any good book on the language.

Otherwise, you have to buy it. Here: http://home.att.net/~jackklein/c/standards.html

A: 

current standard is C++03 but as soon as possible they are outing C++0x (and we all hope that x==9)

I suggest to read "C++ Programming Language" the book of Bjarne Stroustrup. It's the standard.

ugasoft
TC++PL is not the standard.
Steve Jessop
+3  A: 

ISO standards cost money, from a moderate amount (for a PDF version), to a bit more (for a book version).

While they aren't finalised however, they can usually be found online, as drafts. Most of the times the final version doesn't differ significantly from the last draft, so while not perfect, they'll suit just fine.

Pieter
A: 

Wikipedia and usually the documentation that comes with the compiler. Some compilers implement a different standard in some cases.

For example under Windows snprintf function would return negative value in case the buffer was to short while the current linux implementation would return the buffer size needed to hold all the characters.

A good programming book would also be very usefull. Check out Bruce Eckel's Thinking in C++ ... it's free.

Iulian Şerbănoiu
+1  A: 

The ISO C and C++ standards are bloody expensive. On the other hand, the INCITS republishes them for a lot less. http://www.techstreet.com/ seems to have the PDF for $30 (search for INCITS/ISO/IEC 14882:2003).

Hardcopy versions are available, too. Look for the British Standards Institute versions, published by Wiley.

MSalters
+1  A: 

For C/C++ you have to buy the standard to one of the organization supporting it. While it is very expensive to buy it via ISO, the same standard is quite cheap if bought from ANSI (~20$ for C++ standard).

PierreBdR
A: 

The cost of standards can wildly vary based on which organization provides them, too. This is why I'm a fan of ITU standards (such as H.264): they're all completely free online, as the ITU is a branch of the United Nations. Most standards organizations don't provide such luxury.

Dark Shikari
+5  A: 

You might find the latest C++0x draft Standard useful.

James Hopkin
The [FCD](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3092.pdf) is [available now](http://herbsutter.com/2010/04/02/how-anyone-can-comment-on-the-fcd/).
Roger Pate
Thanks - updated now
James Hopkin
A: 

for what kind of questions can the answer be found in "the standard"? usually the standard is referred to by people who have something to do with the C compiler, either implementing it, or testing it, or writing standard libraries.

It would be more helpful for this site if you can ask the questions in question!

Mostly, you should check with the documentation you get with your compiler. If you want help on the while keyword, and you are on visual studio, the better place to look would be msdn. The standard will just throw you off with a lot of BNF grammar rules that are supposed to make sense.

also, as another poster pointed out, there are lot of things which are "implementation defined", which means it is more useful to consult the documentation that came with your compiler than the standard.

kinjal
I frequently write code intended to work on more than one compiler, including compilers as-yet unimagined. The standard is invaluable here (although GCC with `-pedantic` is most of the benefit for a fraction of the effort).
Steve Jessop
A: 

You might find the cppreference site useful at http://www.cppreference.com/

Martin
+3  A: 

The C89/90 and C++03 standards are available in book form from Wiley. C++ Standard on Amazon C Standard on Amazon

Plus, as already mentioned, the working draft for future standards is often available from the committee websites: C++ committee website C committee website

The C-201x draft is available as N1336, and the C++0x draft as N2723.

Anthony Williams
Just a note about the print version for the C Standard from Wiley: it's the C99 standard, not C89/90.
Michael Burr
+24  A: 
Michael Burr
+10  A: 

C99 is available online. Quoted from www.open-std.org:

The lastest publically available version of the standard is the combined C99 + TC1 + TC2, WG14 N1124, dated 2005-05-06. This is a WG14 working paper, but it reflects the consolidated standard at the time of issue. In 2007, TC3 has been published.

+1  A: 

The actual standards documents may not be the most useful. Most compilers do not fully implement the standards and may sometimes actually conflict. So the compiler documentation that you would already have will be more useful. Additionally, the documentation will contain platform-specific remarks and notes on any caveats.

Kris Kumler
+1  A: 

Re the usefulness of the standards drafts versus the PDFs of the ratified versions: I have access to the final PDFs through my university library, and I have found the PDF for the C++ standard to be less useful than the HTML draft. The main reason is cross-references: It's much easier to get to the Overloaded Operators section by clicking on a [over.oper] link than by searching for the section number and skipping all the occurrences that in the table of contents, etc.

Nathan Kitchen
A: 

Google and filetype:pdf are your best friends. Same is true for all technical documents ;)

Autopulated