Hey,
I started learning C++ and now I need to return an array from a function, I already noticed that just returning it as if it was a ormal variable wouldn't work.
Now I wanted to return a pointer to the array but that still gave me compiling errors:
Code:
Terminal output:
Code:
I started learning C++ and now I need to return an array from a function, I already noticed that just returning it as if it was a ormal variable wouldn't work.
Now I wanted to return a pointer to the array but that still gave me compiling errors:
Code:
int function(int array[])
{
//array stuff here
int *pointer = &array;
return pointer;
}
Code:
main.cpp:6:21: Fehler: »int**« kann nicht nach »int*« in Initialisierung umgewandelt werden
main.cpp:8:12: Fehler: ungültige Umwandlung von »int*« in »int« [-fpermissive]