Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Difference between C, C+, C++

Status
Not open for further replies.

zqew05

Mechanical
Aug 22, 2003
65
I am new to this, my background is electromechanical and gas turbines. I just started learning PLC's and getting pretty comfortable with it. My compatriots recommended I take C programming but I don't know the differences. They also said since I have a full-time job I need to buy one of those CD programs for self study. Can someone give me some guidance on what direction to go? THANKS
 
Replies continue below

Recommended for you

C is a general programming language. Small compiler, lots of free compilers. Quite easy to learn once you get the hang of the syntax. It is available on almost every platform you can think of. Note that there are 3 main variants of C: K&R, C89 and C99. Most compilers are C89.

C++ is an Object Oriented variant of C. If you are going the C++ route, don't learn C first: you'll get into a lot of bad habits. However, it is a big language with lots of new concepts. If you are intending to write GUIs, this is probably the way to go. It is not available on as many platforms as C. There is a standard library of algorithms STL which does all the standard stuff like linked lists, vectors etc. There are lots of free compilers about.

C# is a Microsoft Language. It is big, slow, still being developed and a very bad excuse for a faster processor. You can download the Express version from the microsoft site or get the CDs for £3. Don't try it on a system less than 1GHz 256Mb. It is XP based but will work on 2000. It is not a good first language.
 
Forgot to answer the actual question: which direction you should go? It really depends on what you intend to do with it.

If you are going to stick to engineering type programs and programming controllers, stay with C. Lots of C experts out there if you have any questions.

If you are going into developing GUIs or stuff for Mobile Phones, try C++. You can develop GUIs in C too but it is easier in C++ in that each control is an object. Some people use C++ like a lazy variant of C i.e. they use // for comments and make declarations all over the place: not just at the top of the routine. All C++ compilers will compile C. Lots of C++ experts in cyberspace if you get stuck.

If you wish to be tied to Microsoft and .net, torture yourself and have to change compilers every year or so, you could try C#. Most people are still learning C#: it is only about 4 years old. I'd wait another two years before trying C# - it is like Visual Basic when it started. A new compiler is released every year with new features and it is just too much for carbon based lifeforms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor