Beginner Question: The main reason a pointer is used to create GUI window
I'm checking SDL and I see in the initial steps that a pointer of type SDL_WINDOW is made and then when passed to some other functions a window is initialized. I wonder how I should have guessed myself that I had to create a pointer and not a non-pointer variable?
My own guess is that because otherwise unnecessary copying would be needed, whereas using a pointer, the function can return the very address of the only copy. Also my second guess is that a malloc is used inside the function which creates the window, and since malloc works only with pointers then the variable passed to that function must be a pointer too. (Thank you in advance)