Could anyone help me about returning the array from a function? I believe that it is a syntax error (compile time error) to return an array from a function, but one book mentions briefly that using pointer will solve the issue.
However, my current knowledge does not allow me to see how the pointer can solve this C++ limitation (return a pointer might be dangerous because it might point to the address of local variable, and this variable will go out of scope. Hence, this pointer will point to invalid value). I appreciate for your information.