It's been a while since I've worked with C++ and am shaky at remembering how to use arrays properly. I need to return a string from a function but for some reason it's not running correctly. Here's a simplified version.
I'm pretty sure it's outputting those odd characters and numbers because you've initialized digits() as a pointer with *, it's displaying the member location of that function. If you wanted to output digits, you would use cout<<*digits . However, I'm not sure if you can return an array, as I am very new at C++ - But if you directly cout x array via the digits function instead of trying to return the array - it works.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
EDIT ** Sorry - I re-read this thread and apparently you are after returning the array from the function return