tags:

views:

159

answers:

6

What is the difference between C & C# on the basis of OOP concepts?

+2  A: 

There is no OOP in C.

C++ adds object oriented programming support to C. C# is in a whole different generation of languages. It was build to do OO from the ground up (everything is an object).

So, as dreamlax commented, it's comparing apples and oranges.

Marnix van Valen
+8  A: 

The difference is in the support of those OOP concepts. C does not support OOP concepts while C# does.

Darin Dimitrov
+2  A: 

You really mean C or C++? C is not OOP language. I guess that is enough difference.

taskinoor
+1  A: 

The C# is a CIL, OOP language designed for Microsft, C not.

Vash
+1  A: 

C use structured programming while c# object oriented.

Chinjoo
+2  A: 

C, as a language itself, doesn't support OO programming concepts. But it does not make using them impossible. If you're determined and have a good reason for using object oriented approach to C programming (instead of, for example C++) you can do it.

Of course you can't achieve many of higher level languages functions without extensive use of preprocessor, which is not a good idea because it may be reinventing the wheel (not very round wheel in most cases), but basic OO concepts like inheritance and polymorphism are achievable in quite simple way by using arrays of function pointers, "base type structs" struct members in "subtype structs" etc.

Renee