Hi all, I'm struggling to get a function working, and hoping someone could help.
The idea is to have a function which I can call to load all my image files. Everything worked until I added surface pointers to the function, which I need because I intend to move this function to a difference source file, so can't act on the surfaces directly, so need to use pointers.
and this is my call to the function in main(): if( load_images(numberOfImages,imageFileName,surface) == false ){ return 1; }
So the problem is in assigning the surfaces in the function. I keep getting type mismatch issues and can't work out where I've gone wrong. The surfaces are defined as an array of pointers in my main source file. When the function is called it receives the pointer to the first element of the array. The function accepts type SDL_Surface pointer. Load_image returns an SDL_Surface pointer.
Oh, I've got it working. Am I right in thinking that when a function receives an array, it actually just receives a pointer to that array? I was reluctant to write the function this way because I thought I'd be sending more data across than needed (i.e. the full array rather than just a single pointer to it)