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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C and C++

Status
Not open for further replies.

Oak

Programmer
Aug 6, 2000
77
0
0
CA
Hi!

I bought a book about C++ and I have not any base about C. The book told about the fact that we couldn't have any past about C to learn C++.

I'm a [little] confuse about that. Maybe thare's a major difference about them (C-C++).

Thanks.
 
Much of the syntax and keywords are common to both. However, C++ has some additional keywords and adds the object-oriented concepts of classes, polymorphism, etc. C++ requires a different way of thinking and of structuring your programs, just as programming DOS applications is different than programming Windows applications.
 
The reason behind the name C/C++ is that C++ any C++ compiler MUST support the C backward compatibility (The reverse is not true). Meaning, if you coding in VC++ 6.0 you still can write pure C code and compile it with no problems.

Most of the control statements Loops, Branching, Functions definitions [almost] are still the same, if you used to use or you like a library in ur old C code you still can use it.

As our friend programsecrets said, the main deference is the Object-Orientation and the deferent mind set it bring with it and of course the new building blocks C++ implemented to support the new features.

Finally, yes you don’t need to start with C to learn C++. A good book will introduce you to C++ directly, by the way this is a blessing because most of the C programmers still can’t get ride of bad programming techniques C environment forced them to learn.

Thanks


Walid Magd
Engwam@Hotmail.com
 
Thanks.
And what about the Boorland/Microsoft difference?
 
Traditionally, (at least at the time of "Borland C++") the differences were in the libraries that were provided by each vendor to make windows programming easier.

For example, Microsoft included the MFC (Microsoft Foundation Class) library and Borland included the OWL (Object Windows) library. Both libraries provided similar functionality, although the precise names of each of the library functions differed between the two. Although Borland did not include MFC (due to licensing issues), their compiler did support it if you had MFC installed (i.e. you also had Microsoft's VC++ product installed).

Now that Borland has C++ Builder and Microsoft has Visual Studio .net the differences are likely much greater.

I know that Borland's advanced middleware (MIDAS) supports CORBA, whereas Microsoft supports COM+ (now called .net), both of which are designed to do something similar, but which are completely incompatible... so the differences have been getting much greater.

But, if you're asking about basic C, C++ and Windows programming (rather than advanced topics like COM or CORBA), then either implementation can get you started and take you pretty far along the path before they diverge...

If anyone disagrees or would like to clarify anything I've said, please feel free to speak up...
 
Thanks for the tips!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top