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

D

dwaach

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
 
C

Chris Dollin

dwaach said:
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.
 
C

Chris Dollin

dwaach said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top