Question:

Whats the differance between C and C#(C sharp)?

by  |  earlier

0 LIKES UnLike

I would like to know the differance between these two languages? I need to learn C as a part of my engineering course and i want to learn C# for asp.net. Is it easy to learn one and go to the other?

 Tags:

   Report

2 ANSWERS


  1. Short answer:

    C# is based on C and C++, with a lot of microsoft specific code written into it.

    Longer answer:

    C is a common language "spoken" by just about every computer you can get your hands on

    C# is a Microsoft product that, much like Visual Basic, was designed to help modularize the Windows API and COM model and its successors (MFC, .NET, etc).

    Advice:

    If you (or your school) have the money and are just using Windows computers to develop (which seems to be the case), go ahead and learn C#. If you want to write cross-platform stuff, learn C. C# is also used a lot in a lot of modern businesses.

    Both are easy to learn, but C# is going to be more of a "shortcut" for you if you are a windows programmer.

    The advantage to learning C, is that you can use it from any computer, and write programs for any computer. Writing in C for a windows computer, using windows software, isn't really more difficult than C#, although you'll run into a little less support. But everything uses MSDN.

    If you want to be zen master (or you don't have a lot of cash), learn C, then learn how to use a cross-compiler, then learn the windows API, and finally, download mono or rotor onto a linux or bsd system and learn C# and whatever flavor of MFC Microsoft's decided they're running with this year (e.g. .NET). After that point, you can program on, and for, anything in the world.

    I threw in a link to an explanation as to what C# is as well


  2. The differences between the two languages are too massive to list here.  C# has features such as classes, anonymous functions, managed types, garbage handling, operator/function overloading, and many more :| ... C has none of these features.

    Despite the differences in the two languages, it is fairly easy to move from one to the other. I moved from C to C# and learned most of the language features in about a week's time.  The syntax of the two languages is very similar, so you should feel comfortable with both of them if you already learned one.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.