|
I guess they think it's complicated when the truth is the opposite:
Guessing what's wrong, now *that's* difficult!
But we know that, it's just a matter of spreading the word (IMO).
BTW, where's my 1?
|
|
|
|
|
|
OK, you can give it to me another day...
|
|
|
|
|
Hey ! dont keep it in your pockets, It's gonna harm your internals
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
It is reassuring that these are the people who get our outsourced jobs...
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
|
toxcct wrote: is it you who gave me '1' here ??
noooooooooooooooooooooooooo!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Who? Me?
Why in the world should I do that?
Especially since we totally agree on the subject.
If someone did vote you down, then it probably was the same person who voted me down, in the first place.
It seems as if some people gets offended when someone tells them to learn how to use the debugger. Strange...
|
|
|
|
|
Hi again.
The person that gave you a 1 must have missed the "joke" symbol of your post, or is totally lacking all sense of humor.
Again, it wasn't me, truly. I really appreciated your twist.
|
|
|
|
|
|
kakan wrote: Can't give you my 5 this time. Last time I was voted down for giving you a 5.
Sorry i voted you down for not giving Five sorry!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
That's OK, I'm getting used to it.
|
|
|
|
|
kakan wrote: Can't give you my 5 this time. Last time I was voted down for giving you a 5.
Sorry In naughtyness i given you one.. now you have two option get two five (one for this and one free) from me or vote one for this message.. choice is yours
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Is it just me, or is this thread becoming a bit complex to follow?
To be honest, I don't really care about getting fives.
I'm more interested about the original subject.
IMO, a lot of the (mostly the vaguest) questions could be avoided if the poster learnt to use the debugger. Not to mention how much faster the problem would be solved.
(Everyone here knows it takes time to get an answer through a forum).
I totally agree with Cedrik here. Which is at reason I gave him my 5 for his two responses, telling the poster to learn how to use the debugger.
Kakan
|
|
|
|
|
class CBase
{
};
class CDerived: public CBase
{
};
int main()
{
CDerived d;
CBase& b = d;
}
it was quite new information ( i haven't tried yet) that a base class can refer a derived class object. Could you pls explain the what is the difference with using a base class pointer?
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|
|
A reference is treated like a constant pointer.
The big difference between pointers and references is that you must use an explicit operator-the * operator-to dereference a pointer, but you don't use an operator to dereference a reference.
In other words, once you bind a reference to refer to an object, you cannot rebind it to refer to a different object.
Now if you want to assign another derived class object to b you just can't.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 7:31 Wednesday 14th June, 2006
|
|
|
|
|
_AnShUmAn_ wrote: A reference is a constant pointer.
false.
it's a dereferenced pointer, but not const at all.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
I was waiting for that.
:->Made the correction.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
u can consider Reference as const pointer
never say die
|
|
|
|
|
Where are you guys coming up with this stuff? If a reference was a constant pointer then you would need to use the ‘->’ operator instead of the ‘.’ Operator, or you would need to dereference it with the ‘*’ operator.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
John R. Shaw wrote: If a reference was a constant pointer then you would need to use the ‘->’ operator instead of the ‘.’ Operator, or you would need to dereference it with the ‘*’ operator.
...and it would be not possible to alter the object referenced...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
True! But what would also be true is that you could set the reference equal to anouther object if you wanted. Which C++ will not allow you to do whether it is a constant reference or not.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I have been programming for a long time and have never tried doing what you are showing. Does the compiler actually let you set a reference to a base class object to a derived class object. I would understand if you where setting a pointer to a base class object to the address of a derived class object, but regardless of what you have heard a pointer and a reference are not exactly the same thing (although they are related).
You can set a pointer to a base class the address of an object derive from that same class. That is part of the power of C++; if you have a base class for shapes you want to draw and the base class has a virtual function for drawing shapes, then you can build an array of pointers to base class objects and then call the draw function for each of those objects. It is the derived class that does the actual drawing via the virtual function.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I know a base pointer can be used to call derived class function (the object which points to). As you I haven't tried it yet...It came as the part of design suggestion. I just wondered and tried with the sample.
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|