tags:

views:

243

answers:

5

Does C language support inheritence. If so is is it using structures as classes are not defined in C.

+6  A: 

No, it doesn't.

SLaks
+6  A: 

No it doesnt. C is not an Object Oriented language. Inheritance is a property of OO languages.

You should try C++. It's OO and supports much more than inheritance

Midhat
+6  A: 

Yes, it does. See http://gcc.gnu.org/ml/gcc/2010-05/msg00725.html . See Axel-Tobias Schreiner's book Object-Oriented Programming with ANSI C. There's an English translation of it available.

Also, see http://stackoverflow.com/questions/415452/object-orientation-in-c and http://stackoverflow.com/questions/1237266/how-can-inheritance-be-modelled-using-c .

Yktula
He's asking about inheritance, not OOP.
SLaks
+2  A: 

C inherits from ALGOL C Programming Language

Khorkrak
+2  A: 

There is no Compiler-level support for inheritance in C. Nevertheless, as others have already pointed out, Object Oriented coding does not REQUIRE such support. However, its a lot easier to write OO code in C++.

swestrup