C++ solution:
"May I have any accesaccess to a local variable in a different function? If mayso, how?"
The answer is no, not after the function has ended. Local variables are destroyed at that point.
In C++ the way to deal with returning arrays is to manage them in a container like a std::array (fixed size) or a std::vector (dynamic size).
Eg:
void replaceNumberAndPrint(const std::array<int, 3>& array) { printf("%i\n", array[0]); printf("%i\n", array[1]); printf("%i\n", array[2]); } std::array<int, 3> getArray() { std::array<int, 3> myArray = {4, 65, 23}; return myArray; } In the second function the returned value is optimized by the compiler so you don't pay the price of actually copying the array.