C Sharp (programming language)
C# (pronounced "see sharp") is a computer programming language. It is developed by Microsoft. It was created to use all capacities of the .NET platform. The first version was released in 2001. The most recent version is C# 11, which was released in November 2022, alongside .NET 7. C# is a modern language. C#'s development team is led by Anders Hejlsberg, the creator of Delphi.
The title of this article is wrong due to some technical limitations. The right title is C# (programming language). |
Execution Platform
- The Microsoft .NET platform;
- Free implementation of C# and .NET like Mono developed by Novell, or dotGNU developed by the Free Software Foundation.
Today, C# can be run on most platforms (Windows, Linux, macOS, etc.) without changing the source code. C# can be run on the Xbox 360 platform with a special framework.
Syntax
C# code is similar to C++ and Java code. The CLR (Common Language Runtime) is needed in order to run a C# program.[2]
"Hello, World!" example
/* 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 prevent the program from closing immediately.
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
}
Basic input example
/*
* 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
C# can be edited in a number of IDEs (Integrated Development Environments), some of which are listed below:
Windows:
- Microsoft Visual Studio
- SharpDevelop
- Visual C#
- Visual C# Express
- Rider
Mac OS X:
- MonoDevelop (With limitations)
- Microsoft Visual Studio
Unix/Linux:
Sources
- "Announcing C# 12". Retrieved 18 November 2023.
- Collected Computer Programming Problems in Visual C#.Net, Hary Gunarto. Tech Publication, Singapore. 2007. ISBN 978-9812141743.
Related pages
Other websites
- C#.NET in Hindi - सीखें आसानी से।
- C# Station, Example, Video
- Visual C# Developer Center
- C# lessons Archived 2014-05-28 at the Wayback Machine
- c# continue at CodeExampler for Free
- C# Station Archived 2007-12-20 at the Wayback Machine
- Visual C#
- Introduction to the C# Language and the .NET Framework
- C# / CSharp Tutorial
- Visual C# Tutorials and Lessons (Learn C#) Archived 2013-04-06 at the Wayback Machine
- Visual C# .NET Programming on http://www.homeandlearn.co.uk/
- Examples for C# Essentials Archived 2012-05-30 at the Wayback Machine
- Learn C# with Examples (C# Tutorial)
- C# Programming Examples Archived 2021-05-07 at the Wayback Machine