0
What is the difference between C++ and C#
Okay I've been coding for half a year and I think it's time to move onto a more complex language than python, I know that java and JavaScript are completely different languages for example, but what is the difference between C, C++ and C#?
3 Answers
+ 2
C
One of the oldest programming languages, itâs quite simple and old school compared to others with a lack of modern features (like classes) but we still love it, example hello world program in C:
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}
C++
This language is also quite old as it came out around a decade after C, it was created to improve C by adding modern features like classes, lambda functions ect. Since it was an improvement and the developers strived to be somewhat backwards compatible all of C features were ported over. Example hello world program in C++:
#include <iostream>
int main() {
std::cout << "Hello World!";
return 0;
}
C#
C# has hardly anything in common with C/C++ other than some syntax and features. It was developed by Microsoft and is part of the .NET framework it was designed to be similar to Java. Example hello world program in C#:
using System;
namespace HelloWorld {
class Program {
static void Main() {
Console.WriteLine("Hello World!");
}
}
}
+ 2
Duplicate, asked very frequently.
We could add that to the FAQ.
+ 1
It is completely different programming languages. Like Java and Javascript, like Python and Ocaml, like HTML and CSS.