Quote: "I have a question what is the difference between c++ and c#?
Because I'm thinking about learning one of those."
Well, I'll give you a quick example of two classes done within the two.
First we'll have C++.
(Classes.h I guess?)
#pragma once
#include <stdio.h>
class Class
{
protected:
const char* m_string;
public:
Class(const char* string);
~Class(void);
};
class Class2 : public Class
{
public:
Class2(const char* string);
~Class2();
void sayHello();
};
(Clases.cpp)
#include "Class.h"
Class::Class(const char* string)
{
m_string = string;
}
Class::~Class(void)
{
}
Class2::Class2(const char* string)
: Class(string)
{
}
Class2::~Class2()
{
}
void Class2::sayHello()
{
printf("%s", m_string);
}
Now for C#:
Class1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test
{
public class Class1
{
protected String m_string;
public Class1(String str)
{
m_string = str;
}
}
}
Class2.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test
{
public class Class2 : Class1
{
public Class2(String str)
: base(str)
{
}
public void SayHello()
{
Console.WriteLine(m_string);
}
}
}
Forgive the messy code, but that should give you an idea of how the syntax differs.
Other than that, C++ is cross platform. C# runs off of the .net platform which is only for windows. C# is compiled to bytecode whereas C++ is compiled into pure machine code.
I believe that covers all I wanted to cover...
Edit - Oh, and generally when programming, I would have separated those two classes into:
Class1.h, Class1.cpp, Class2.h, and Class2.cpp for C++.
Quote: "I made a very simple space shooter in XNA with C#"
I enjoyed XNA when using it. I feel like Microsoft did right releasing that. It really gives, in my opinion, a good gateway for people entering the game development community.