473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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 1407
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dmitri Zhukov | last post by:
Hello everyone, I am implementing software which has a medium sized number of text strings (max 100K) which are represented in a listbox. I want user to be able to search the string by typing...
3
by: Ivan Neganov | last post by:
Hi, I have a custom subclass of System.IO.Stream type. I wonder how to correctly implement the IDisposable pattern in this situation. The parent Stream type apparently uses explicit interface...
4
by: Frank J. Reashore | last post by:
Hello Everyone, I am implementing a simple interface in C# using Visual Studio .net and was quite surprised to discover that the C# compiler does NOT complain if a method on the interface is not...
7
by: Scott M. | last post by:
In a typical class, do I need to indicate that it implements the IDisposable interface and then create a Dispose method that implements the Dispose required by the IDisposable interface or can I...
4
by: phl | last post by:
hi, My question is: 1. To avoid possible memory leaks, when you use this pattern, after you have dealth with the unmanaged resources and before you take your object off the finalize queue,...
3
by: dwaach | last post by:
Hi, I am thinking about implementing isInstanceOf() in c. Any ideas ??? Ex. int findType(struct x) { struct X orgX;
6
by: Raj Wall | last post by:
Hi, I am trying to implement the IEqualityComparer interface for a struct so I can use it as the Key for a Dictionary. My struct declaration has: public struct Ring : IEqualityComparer {...
5
by: koonda | last post by:
Hi all, I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the...
4
by: Ognjen Bezanov | last post by:
Hello All, I am a third year computer science student and I'm the process of selection for my final year project. One option that was thought up was the idea of implement my own version of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.