I ran into the following problem: I want to return a Y-coordinate, and after I returned it, it needs to be deleted.
Is there a way to do this, because I think I'm missing some major things here.
void setY(int y)
    {
        this->y = new(int); //pointing to new address
        *this->y = y; //change value of pointer
    }
    int getY()
    {
        return *y; //give the coordinate
        delete y; //what I want
        *y = NULL; //what I want
    }
Thank you in advance. If the question is not well described, please let me know.
 
     
     
     
     
    