I am currently working on my game project, i came across a problem/a thing i did not know
If i make something like this :
std::vector <SDL_Surface*> SurfaceList;
And use function to get member of "SurfaceList" like
SDL_Surface& GETR_SurfaceList(int which);
//Which does
SDL_Surface& class::GETR_SurfaceList(int which)
{
return SurfaceList[which];
}//I know the pros and cons of vector and i am aware of issues that this may cause
/*But this will return Reference to this SDL_Surface*
so can i inside my main do next */
int main(int argc, char**)
{
//Function to load/populate/ADD $HIT TO SurfaceList is called
SDL_Surface* tempSurf = GETR_SurfaceList[0]; // is this valid ?
}