Nightshade wrote:What is the difference between C, C++, and C#?
C: Not an object-oriented programming (OOP) language (
http://en.wikipedia.org/wiki/Object-ori ... rogramming ) and a very low level programming language. More often than not, it's used to create operating systems or software that works very close to the operating system (from my experience, mostly Linux).
C++

Like C, but an OOP language. The key difference is that it's an OOP language but it's really an "extension" to C. It's higher level (meaning that it's farther from binary and even closer to human-readable) but is still extremely efficient in performance and speed. But, like in C, memory management is critical to understand to truly have an efficient program.
C#: Extremely different than C and C++. Most people like to say it's like Java, but it's not except for the "syntax" of the language... That's a whole different conversation and I can go on and on about that. C# is also a high-level programming language, but even though it's much higher level, it's an extremely powerful language and applications can be just as good as if they were written in C++ instead. Also, memory management is less of a concern (although it's still a concern when you deal with pointers and dynamic programming) because C# takes care of it with a "Garbage Collector" like in Java.
As for syntax between all three, C and C++ look very similar and C# is the oddball out. The reason it still uses the letter "C" is probably because it allows you to use pointers and import C++ code and dll files into it... I'm not 100% sure on that one though.
I'm literally typing this all at the top of my head... It's been awhile since I've programmed in C++ so I may have it wrong, but here's a sample of the difference in "Hello World" programs between the three:
C:
Code: Select all
#include <stdio.h>
int main(int argc, char* argv[])
{
printf("Hello, World!\n");
return 0;
}
C++:
Code: Select all
#include <iostream>
int main(int argc, char* argv[])
{
std::cout << "Hello, World!" << std::endl;
return 0;
}
C#:
Code: Select all
using System;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}