Does C language support inheritence. If so is is it using structures as classes are not defined in C.
-
Sorry that was a mistake i meant C only. Thanks – ckv Jun 06 '10 at 19:09
-
2You seem to be asking many questions that could be answered by reading a basic textbook on C or C++. Do you have something against the printed page? – Jun 06 '10 at 19:10
-
No there are doubts that come to your mind sometimes when you read the textbooks. – ckv Jun 06 '10 at 19:13
-
3Inheritance and other OO features _can_ be simulated in C. – Yktula Jun 06 '10 at 19:15
-
1I think this downvoting is uncalled for. Discuss on http://meta.stackexchange.com/questions/33376/is-it-bad-to-ask-google-searchable-questions-on-stack-overflow – Midhat Jun 06 '10 at 19:16
-
2@Yktula: you spelled *implemented* as *simulated*. – dmckee --- ex-moderator kitten Jun 06 '10 at 19:36
10 Answers
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 Object-orientation in C and How can Inheritance be modelled using C? .
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
- 16,940
- 19
- 85
- 114
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++.
- 4,071
- 3
- 21
- 30
C is not an Object Oriented language. Inheritance is a property of Object Oriented languages. There is no Compiler-level support for inheritance in C. Object Oriented coding does not REQUIRE such support.
- 69
- 1
- 5
No it doesn't. C is not an Object Oriented language. You can try C++ or Java for inheritance functionality.
- 1
- 2
C is not an object oriented language as inheritance is supported only in object oriented programming language C doesn't support inheritance
- 1