468,469 Members | 2,497 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,469 developers. It's quick & easy.

implementing isInstanceOf() in C, any ideas ???

Hi,

I am thinking about implementing isInstanceOf() in c.
Any ideas ???
Ex.
int findType(struct x)
{
struct X orgX;
if (isInstanceOf(x, orgX))
return 1;
else
return 0;

}
main()
{
struct Y x;
int val=0;
val=findType(x);
}
Regards,
Abhishek

Jul 10 '06 #1
3 1223
dwaach wrote:
Hi,

I am thinking about implementing isInstanceOf() in c.
Any ideas ???
Yes: you're rather out of your depth. Put some effort into
learning C first.

--
Chris "object disoriented" Dollin
"Never ask that question!" Ambassador Kosh, /Babylon 5/

Jul 10 '06 #2
learn from where and what to learn?

Chris Dollin wrote:
dwaach wrote:
Hi,

I am thinking about implementing isInstanceOf() in c.
Any ideas ???

Yes: you're rather out of your depth. Put some effort into
learning C first.

--
Chris "object disoriented" Dollin
"Never ask that question!" Ambassador Kosh, /Babylon 5/
Jul 10 '06 #3
dwaach wrote:
learn from where and what to learn?
For starters, learn not to top-post.

Learn C from where: I'd say K&R2. Take your time, ask questions
if you get stuck.

What to learn: the language and it's style.

Noting, in particular, that C is /not/ the kind of language for
which isInstanceOf is a terribly useful question. If someone
wants to do so, I anticipate two major possibilities:

(a) they have completely the wrong idea about what kind of
language C is, and would be better off with a different
one: /which/ different one I'd not like to guess.

(b) they're implementation-oriented people who need to put
an OO layer over C and need to know what C promises so
they can do so as safely as their context permits.

(b) people are likely to come with rather more specific questions
and code snippets. (a) people are likely out of their depth.

I reserve my right to be wrong: I've worked hard for it.

--
Chris "with a quota" Dollin
"We did not have time to find out everything we wanted to know." /A Clash of Cymbals/

Jul 10 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dmitri Zhukov | last post: by
3 posts views Thread by Ivan Neganov | last post: by
4 posts views Thread by Frank J. Reashore | last post: by
4 posts views Thread by phl | last post: by
4 posts views Thread by Ognjen Bezanov | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.