CyberArmy Academy | CyberArmy Services & Support | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Projects

RE: C, C++, C#


[Replies] [Reply] [View by Thread] [Help]
[Back To Programma Akademeia]

Posted by Delta Gen int16h On 2008-03-03 23:22:24
In Reply to C, C++, C# Posted by Tr Gorydeath On 2008-03-03 22:59:40

Delta GenDelta Gen
Delta Gen int16h


Hello :)

C (as you can imagine) came before C++, in C syntax - C++ would mean C-incremented. Probably the largest difference between these 2 is that C++ was designed with OOP (Object Oriented Programming) in mind. Thus it uses objects, classes etc and will require the knowledge and/or use of constructors and inheritance (concepts you will come across in many OOP languages).

C is much easier to learn and work with for a lot of people, but apart from that - it has superior performance (afaik). There are also some syntax differences (which I won't go into here, I suggest you research each language and look at example code :). C++ provides most of the same functionality as C, but also much more or superior alternatives.

C# is Microsoft's way of taking C++ and 'improving' it, by taking some Delphi/Pascal, Java and some other languages along the way and giving it a blessing with M$ holy water. I'm not overly fond of C# as I dislike the bloat/bad performance of it and .Net (in comparison to C or Asm), but that's as far as my personal opinion will go on this ;p. C#, like C++, Delphi and Java is an OO language, and in a way I look at it as an alternative to C/C++ as Python is now a popular alternative to Perl (Easier to use, but perhaps with performance penalties).

Here are a few basic "Hello, World" apps in each language:

C
#include <stdio.h>
 
 int main(void)
 {
    printf("Hello, world!\n");
    return 0;
 }
C++
#include <iostream>
 
int main()
{
    std::cout << "Hello, world!\n";
}
C#
class HelloWorld
 {
     static void Main()
     {
         System.Console.WriteLine("Hello, world!");
     }
 }
I hope this has helped slightly, it's correct as I know it - but do not have statistics to back it up :P.


Replies:


Guest:
Subject:
Message:
Signature:
Optional Image Link:
http://

CyberArmy::Forum v0.6
Generated In 0.01676 seconds


About Us | Privacy Policy | Mission Statement | Help