First of all, if i remember right, functions are NOT suppose to return pointers, because when they go out of scope, the address the pointer was pointing too gets filled up with something else
This is inaccurate. It is very very common to return pointers from functions; for example, a pointer to a struct or c++ object being returned from a function is very common. You wouldn't be returning the pointer to the function's location but rather the struct's location in memory (but things like this are why you have to be careful with pointers), and always be sure not to leave dangling ones


/nebulus