Sunday, July 12, 2009

How do you return a pointer from a function in c++?

Just assign the desired variable to the pointer that was used in the function.

How do you return a pointer from a function in c++?
int* func1()


{


int* a;


return a;


}


No comments:

Post a Comment