Does anyone know if there's a way to pass a variable that i have created inside of a method to another method . I am posting part of the code so that it is clearer what i need to do
int Point::trovaLato(Point *spigolo2, Point *sol_p, Point *pvet){
//code
//code
Point* lato=new Point(myvalue1,myvalue2,myvalue3);
return 0;
}
Now i want to use that variable 'lato' inside of
int Rettangolo::interseca(Point *sol_p, Point *pvet){
int ritlat, test;
test = punti[0]->trovaLato(punti[1], sol_p, pvet); //this works
if(test){
test = punti[1]->trovaLato(punti[2], sol_p, pvet);//ok
if(!test){
ritlat = lato->intersecaLato(punti[1], punti[2]); //doesn't know what lato is ofcourse :(
//more code
}
Thanks a lot