Problem passing objects between functions
twizansky_at_yahoo.com
Date: 08/18/04
- Next message: Victor Bazarov: "Re: Problem passing objects between functions"
- Previous message: Niels Dekker - no reply address: "Re: itoa function in gcc"
- Next in thread: Victor Bazarov: "Re: Problem passing objects between functions"
- Reply: Victor Bazarov: "Re: Problem passing objects between functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Aug 2004 10:16:59 -0700
Hello,
I have a problem with values of object properties changing seemingly
on their own. I am completeley baffled and would appreciate any
assistance.
specifically, I have a class called eetosfermions with the follwing
constructor:
eetosfermions::eetosfermions(int id1, int id2, SUSYspectrum & ss):
eetosparticles(id1, id2, ss, 1) { }
eetosfermions inherits from eetoapraticles which has the following
constructor:
eetosparticles::eetosparticles(int id1, int id2, SUSYspectrum & ss,
nFinal) {
cout << ss.mN1 << endl;
.
.
.
}
SUSYspectrum is a class with an 'double' property called mN1.
When I run the following code:
int main () {
SUSYspectrum S
.
.
// initialize S
.
.
cout << S.mN1 << endl;
eetosfermions p(1000012, -1000012, S);
}
I recieve the follwing output:
98.2857
6.36649e-314
The value of S.mN1 has changed without me doing anything! there is no
code between the two cout commands.
Does anyone have any idea what might be going on?
Thank you very much
Tommer
- Next message: Victor Bazarov: "Re: Problem passing objects between functions"
- Previous message: Niels Dekker - no reply address: "Re: itoa function in gcc"
- Next in thread: Victor Bazarov: "Re: Problem passing objects between functions"
- Reply: Victor Bazarov: "Re: Problem passing objects between functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]