Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C89 or C99?

Status
Not open for further replies.

Wuu

Technical User
Nov 18, 2007
33
US
Hi,

I am just starting to learn C++ (Mostly ISO/ANSI C++). But as I did some research on the Web, there turned out to be more than one standard. It seems very weird to me.

Two phases I frequently come across are C89 or C99. Are these the two latest standards? Which has more popularity?

Besides the sample codes provided with the books I am using, I also download sample codes off the Internet.

What confuses me is, some codes use iostream.h, while others omit the .h extension. Which one is the C89, or the C99 standard, or neither? Learning two standards really is a headache. I am trying my best to focus on one specification, before I plunge into the difference among various variations.

Thanks
 
C89 & C99 are the two most recent C standards, not C++.
I think C++98 is the latest C++ standard, but a new one is almost ready to be standardized.
They get together every 5-10 years to discuss new additions that should be made to a language, then they argue about the pros & cons of each idea for a few years until they finally agree on a final set to be released.

<iostream.h> is ancient! In C++, you should use <iostream>, <cstring>, <cstdlib>... instead of the .h versions.

I believe the most common standards in use now are C89 & C++ 98.
 
Thanks, cpjust.

But why is C99 more popular than C89? Isn't C99 more recent?

Can you recommend some software that can serve as a good compiler for both C89 AND C++98?
 
Popularity: people like new things but are you sure it is more popular. Most compilers are still C89 or if they are C99, they run with a C89 compatibility flag.

Try gcc.

 
thanks, xwb. I would take a look at gcc.
 
If you're starting new development, then use the newest standard. It doesn't make sense to use the old version since going forward the tools and libraries will all be moving towards the latest standard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top