Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Programming /Difference Between C and C#

Difference Between C and C#

November 13, 2011Posted byAdmin

C vs C# | C Sharp vs C Languages

Since 1950, many programming languages have been incepted, while some are purely new and others are variants of existing to support numerous programming paradigms. Both C and C# are programming languages, which were introduced as variants of existing languages. It is known that C’s predecessor is B, originally developed by Ken Thompson, with contributions from Dennis Ritchie, and C# was designed with the concept C-like Object Oriented Language in mind. C is being used for system and application software development, whereas C# is much better for application software development.

C Language

C是一种通用编程语言,它was originally developed by late Dennis Ritchie at the Bell Labs in 1972. Though the idea of language was to support user friendly system programming, it has been used for major programs in different domains.

C is a typed language where both fundamental and derived data types are present, and expressions are formed from operators and operands. C is a structural programming language, which provides fundamental control-flow constructions withif-else, switch, while and etc.In addition, input and output can be directed to the terminal or to the files, and the related data can be stored together in arrays or structures. The program is supported with functions, which will return values of basic types, structures, unions or pointers. And functions are recursively callable.

C is a light weight language, and a C program consists of source and header files. The C compilation starts with C preprocessor substitutes macros in the program files. Then the C compiler converts the code to the assembly code. The assembler converts the assembly code to the object code before the Link Editor combines the library functions or functions defined in other source files referenced by program source code (with main()) to create an executable file.

C# Language

C# was developed by Microsoft, whose development team was led by Anders Hejlsberg. C# is an object-oriented programming language that offers very good features such as array bounds checking, strong type checking, and automatic garbage collection. It is truly a high-level language for the developers because of the software robustness, durability, and programmer productivity.

C# programs are organized using namespaces, which offer a hierarchical means of organizing elements of one or more programs.

The language supports mainly two types: value types and reference types. It supports boxing and un-boxing through its implementation of variables as objects. It supports C++ templates via Generics, which are very important in generic programming. Though the language does not have an explicit preprocessor, the C preprocessor based symbol defining is supported.

In C#, the source code is compiled to a CIL (common intermediate language) code, and at runtime, this CIL code is converted to machine code using JIT (Just In Time) compiler. This pre execution-time compilation needs to take place on the computer that the program is to be executed, because it will evaluate the machine characteristics (processor, memory, and so on) in order to generate code that is more efficient.

What is the difference betweenC and C#?

• C# is an object oriented programming language, while C is a structural language.

• C can access low level OS functions making it better in performance compared to C#.

• C# is a ‘managed’ language, which means that code compiles to an intermediate form that then runs on a virtual machine. This particular VM is known as “CLR” or Common Language Runtime. But C is an ‘unmanaged’ language where the code is compiled to its native form.

•在present context, C is used for system programming and performance critical programs, while C# offers solutions for web, desktop and mobile.

• C offers strong pointer manipulation and arithmetic, while C# only offers pointers in unsafe mode.

• Memory management is not a programmer’s duty in C#, which is supported by Garbage Collection.

• C supports macro, which C# does not.

• The concept of global variables, functions, and constants is avoided in C# by replacing it with static members of public classes.

• C allows default arguments on function parameters.

• In C#, array bound checking and defined size types are present.

• C# offers advanced runtime type information and reflection.

• C is fairly a light language, whereas C# is huge.

• C# has built-in support for threading.

• In C# arithmetic operations can be checked for overflows.

• C# conceptualizes all data types to objects which in turn supports a lot of data type manipulations.

Related posts:

Difference Between C and C++ Difference Between Java and JavaScript Difference Between Java and C language Difference Between Procedures and Functions in Programming Difference Between Hashtable and Hashmap

Filed Under:ProgrammingTagged With:C,C language,C Sharp,C sharp Language,C sharp vs,C vs,CSharp,object oriented programming language,structural programming language

About the Author:Admin

Coming from Engineering cum Human Resource Development background, has over 10 years experience in content developmet and management.

Leave a ReplyCancel reply

Your email address will not be published.Required fields are marked*

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

不同的气味,味道和香味的

Difference Between Star Trek and Star Wars

Difference Between Star Trek and Star Wars

Difference Between Bryozoans and Corals

Difference Between Bryozoans and Corals

Difference Between Jupiter and Zeus

Difference Between Agnathans and Gnathostomata

Difference Between Agnathans and Gnathostomata

Latest Posts

  • What is the Difference Between Induction Cooker and Normal Cooker
  • What is the Difference Between Vitiligo and Psoriasis
  • What is the Difference Between Cancellous and Cortical Bone
  • What is the Difference Between Electric and Induction Cooktop
  • What is the Difference Between Prevention and Cure
  • What is the Difference Between DSM IV and DSM V Autism
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018Difference Between. All rights reserved.Terms of Useand Privacy Policy:Legal.