C Sharp (programming language)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Icon falscher Titel.svg The title of this article is wrong due to some technical limitations. The right title is C# (programming language).
C#
Designed byMicrosoft
DeveloperMicrosoft
First appeared2000; 18 years ago (2000)
Stable release7.0 / March 7, 2017; 20 months ago (2017-03-07)
Filename extensions.cs
Websitewww.visualstudio.com

C# (pronounced "see sharp") is a computer programming language. It is developed by Microsoft. It was created to use all capacities of .NET platform. The first version was released in 2001. The most recent version is C# 7.0, which was released in March 2017. C# is a modern language. C#'s development team is led by Anders Hejlsberg, the creator of Delphi.

Execution Platform[change | change source]

Today, C# can be run on most platforms (Windows, Linux, etc.) without changing the source code. C# can be run on the Xbox 360 platform with a special framework.

Syntax[change | change source]

C# code is similar to C++ and Java code. The CLR (Common Language Runtime) is needed in order to run a C# program.

"Hello, World!" example[change | change source]

/* This is a simple program in C#. 
 * It simply shows "Hello, World!" on the screen.
 */
using System;
namespace HelloWorld
{
  class Hello
  {
    static void Main()
    {
      Console.WriteLine("Hello, World!");
      
      // The piece of code below is optional, but is needed to make the program work properly.
      
      Console.WriteLine("Press any key to exit.");
      Console.ReadKey();
    }
  } 
}

Basic input example[change | change source]

/* 
 * This program asks for input from the user, i.e. a name. It then prints "Hello [name]", replacing [name] with whatever the person typed in.
 */
using System;
namespace HelloWorld
{
  class Hello
  {
    static void Main()
    {
      Console.WriteLine("Hello, please type in your name:");
      string name = Console.ReadLine();
      Console.WriteLine("Hello {0}",name);
      Console.ReadKey();
    }
  } 
}

Integrated Development Environments[change | change source]

C# can be edited in a number of IDEs (Integrated Development Environments), some of which are listed below:

Windows:

Mac OS X:

Unix/Linux:

Related pages[change | change source]

Other websites[change | change source]