Re: Quick question!
- From: "Robby" <logicom@xxxxxxxxxxxx>
- Date: Mon, 29 May 2006 21:06:34 -0700
Thanks David for your input!
Thankyou to all!
Later!
Best regards
Roberto
"David Wilkinson" <no-reply@xxxxxxxxxxxx> wrote in message
news:%23$WTtcwgGHA.2208@xxxxxxxxxxxxxxxxxxxxxxx
Robby wrote:
Hey David!
You did it again! :-)
*IT COMPILES WITHOUT ANY ARRORS*
So, I will try this new "Forward declaration" stuff you just tought me
with all the rest of my other pointers to objects that I want to pass to
this function. I know that Abdo mentioned it in his post as:
2. Use forward-reference *before* the #include of SFC_1.h
however this is new to me and I didn't know how to apply the syntax?
However thankyou also Abdo!
One thing though, If I do use:
class components; // forward declaration
in my SFC1.h file, what happens to all the other objects that derive from
it.... are they automatically declared also, or must I do this for all
the others too?
And David, one last question............ As a few posts back you talked
about me using the stack instead of using new which would otherwise make
me look like a Java programmer :) remember? Well.... while we are on the
subject, one of my buddies has an IT company and he says that everyone is
going on JAVA and that C++/VC++ will eventually not be very popular
anymore! This discouraged me, but I know that I must take his opinion
lightly since he is no major beer in the IT world. Anyways, I and I am
sure of it for many others, put alot of time in a language like C... what
is your opinion on the future existance of C++ and VC++?
[snip]
Robby:
When you forward declare, for example
class components; // forward declaration
you are just telling the compiler that there is a class called components.
If the compiler needs to recognize the names of other classes derived from
components, then you must forward declare those also.
A good rule to follow with headers is: Every header should compile by
itself (i.e. when included in an empty .cpp file). Forward declaration is
often sufficient to achieve this.
Just my opinion, but I would say that today .NET is a much greater threat
to traditional C/C++ than Java.
David Wilkinson
.
- References:
- Re: Quick question!
- From: David Wilkinson
- Re: Quick question!
- From: Robby
- Re: Quick question!
- From: David Wilkinson
- Re: Quick question!
- Prev by Date: Re: How to ensure that a double is not 0.0?
- Next by Date: const throw()
- Previous by thread: Re: Quick question!
- Next by thread: Re: Quick question!
- Index(es):
Relevant Pages
|