Difference between C# and C programming Language?

C# vs C.
How C# Differs From C programming Language? please explain



Views: 792 | Community Opinion: 1

Tags..  Programming Language  C  C# interview

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 

If you have been exposed to C, or if you are an experienced C programmer, you can see following main differences between C# and C syntax:


C# does not usually make use of pointers. You can only increment, or decrement a variable as if it were an actual memory pointer inside a special unsafe block.

You can declare variables anywhere inside a method you want to; they don’t have to be at the beginning of the method.


You don’t have to declare an object before you use it; you can define it just as you need it.

C# has a somewhat different definition of the struct types, and does not support the idea of a union at all.

C# has enumerated types, which allow a series of named values, such as colors or day names, to be assigned sequential numbers, but the syntax is rather different.

C# does not have bit fields: variables that take up less than a byte of storage.

C# does not allow variable length argument lists. You have to define a method for each number and type of argument. However C# allows for the last argument of a function to be a variable parameter array.






Register or Login to Post Your Opinion