By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,130 Members | 1,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,130 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.