Page 1 of 1

problem with my class in c++ now with the real files

Posted: Sat Apr 21, 2007 1:11 pm
by kompromis
i haw a problem with my class in c++
i have a class like this
files: http://64digits.com/users/lalle_calle/Ny_mapp.zip

Code: Select all

class connect
{
public:
void  fununction1();
void  fununction2();
private:
double socketadress;
};
void  connect::fununction1()
{
socketadress = opengateaway("ip", port,mode)
std::cout<<socketadress<<std::endl;// now it shows the correct number
}
void  connect::fununction2()
{
std::cout<<socketadress<<std::endl;// now it whill be like the variable was never set an it will give an error
and the object destructeor will automatily activate
}

Posted: Sat Apr 21, 2007 1:17 pm
by Perceval
First, it's not an irrlicht related problem. Then, you should post your entire code, so we can make sure you don't change the variable value.

Posted: Sat Apr 21, 2007 1:45 pm
by spopo
Yeh, you should post the entire code, cause everything seems fine now.

And it is function, not fununction.

And (i used my telepathic abilities once again) i think you called fununction2 before fununction1, so socketadress left undefined.

Posted: Sat Apr 21, 2007 3:09 pm
by kompromis
i think i might have solved it after like 7-8 hours

Posted: Sat Apr 21, 2007 3:42 pm
by Perceval
Sorry, but the link don't work. :?
Just post your code, it would be easier.

Posted: Sat Apr 21, 2007 4:55 pm
by kompromis
well i removed the file after i solved it my self
the thing was to use

Code: Select all

okjh = new connect;
instead of

Code: Select all

connect okjh;