|
-
February 1st, 2006, 11:05 PM
#1
oop with c?
hi,
i heared it's possible to use oop in C.
does someone can give me a brief introduction of how it is being done?
thanks in advance
-
February 2nd, 2006, 12:27 AM
#2
-
February 2nd, 2006, 03:24 AM
#3
Re: oop with c?
May I ask why you want to mimick OOP in C instead of using C++?
-
February 2nd, 2006, 03:29 AM
#4
Re: oop with c?
 Originally Posted by Marc G
May I ask why you want to mimick OOP in C instead of using C++?
Maybe just for fun.
They have a show on Discovery Channel, I think it is called "Lost secrets of the Ancient World" or something like that. In that show a bunch of guys have to build bridges, cranes, ships etc using only ancient materials, technologies and tools. ( not that C is ancient or anything)
Har Har
-
February 2nd, 2006, 04:02 AM
#5
Re: oop with c?
 Originally Posted by SunCore
hi,
use oop in C.
try Object oriented Programming in c ul get all the stuff that u need....
n also found This
You should read this paper on OO in ansi C
regards
- Sreehari
"Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us."
" Everybody is sent to Earth on a purpose. I am so Lagging behind that i won't die." – Calvin
-
February 2nd, 2006, 06:12 AM
#6
Re: oop with c?
There is another point: if you by some circumstances need to program in C, it's generally better to use OOP style.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
February 2nd, 2006, 06:26 AM
#7
Re: oop with c?
 Originally Posted by RoboTact
There is another point: if you by some circumstances need to program in C, it's generally better to use OOP style.
Why?
Har Har
-
February 2nd, 2006, 06:29 AM
#8
Re: oop with c?
You use lots of structs, construct with Create() functions and destroy with Destroy() functions.
Polymorphism is achieved with pointers to functions.
-
February 2nd, 2006, 06:35 AM
#9
Re: oop with c?
It is possible to simulate OOP in C but I'm not sure if it is worth it. If the decission to use C and not C++ was correct it means that you do not need an OOP approach and that you are aiming for something else. In that case why use OOP?
This is a more generic question actually: why force OOP on languages not designed for it? ASM, Visual Basic etc are fine languages for the tasks they were designed to. OOP is not among those tasks.
Har Har
-
February 2nd, 2006, 06:37 AM
#10
Re: oop with c?
I don't get exactly why anyone would choose C nowadays.
-
February 2nd, 2006, 06:39 AM
#11
Re: oop with c?
 Originally Posted by NMTop40
I don't get exactly why anyone would choose C nowadays.
I think a hardcore C# programmer asks himself the very same question.
Har Har
-
February 2nd, 2006, 06:55 AM
#12
Re: oop with c?
 Originally Posted by PadexArt
It is possible to simulate OOP in C but I'm not sure if it is worth it. If the decission to use C and not C++ was correct it means that you do not need an OOP approach and that you are aiming for something else.
It doesn't. There may be external causes forcing to use C.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
February 2nd, 2006, 06:56 AM
#13
Re: oop with c?
 Originally Posted by RoboTact
It doesn't. There may be external causes forcing to use C.
Then the decission to use C is not correct.
Har Har
-
February 2nd, 2006, 07:22 AM
#14
Re: oop with c?
 Originally Posted by PadexArt
Then the decission to use C is not correct. 
There may be singleton decision space.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
February 2nd, 2006, 07:25 AM
#15
Re: oop with c?
 Originally Posted by RoboTact
There may be singleton decision space.
Ouch.
Har Har
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|