Is this statement true??
Writing object oriented code, even in non-object oriented language.
Can anybody site an example.. or provide some links…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can do that, You can simulate OOP concepts like Inheritance and Polymorphism in a procedural language like c.
Since you ask for a Code Example, Here is one:
To simulate Inheritance all you need is the first member of a structure be an instance of the superclass, and then you can cast around pointers to base and derived classes just like C++ inheritance.
Ofcourse, If you really need OOP you should use a OOP language rather than playing around this way.