Function calling

closed account (NUj6URfi)
I have a function called

void SDL_Movie (int argc, char** args[]) {

To call it I said

SDL_Movie(int argc, char** args);

I get the errors

expected primary-expression before "int"
expected primary-expression before "char"
`SDL_Movie' undeclared (first use this function)

The third one I especially don't get because I defined my function by typing

void SDL_movie (int argc, char** args[]);

What can I do to fix these errors?
SDL_Movie(argc, args);

Provided you declared a variable named argc of type int and variable of type char pointer to pointer called args
Last edited on
closed account (NUj6URfi)
What do I do with that code? Will it take away my errors?
Yes provided you have declared the variables argc and args
When you call a function you must to supply arguments that is some expressions. Instead of this you suplied declarations of parameters

SDL_Movie(int argc, char** args);

For example int argc is not an expression. It is a declaration of identifier argc as having type int.

P.S. I wonder why are you getting into SDL if you know nothing in C++?!
Last edited on
closed account (NUj6URfi)
I do know some stuff, I just have never messed with the () after main or void or whatever. What's my solution vlad?
closed account (NUj6URfi)
Bump.
closed account (NUj6URfi)
Just how can I call this function?
I already gave you the way to call the function. If you still do not recognize that as a way of calling functions, you might want to take a look as some tutorials

Beginner:
http://www.cplusplus.com/doc/tutorial/functions/

Advanced:
http://www.cplusplus.com/doc/tutorial/functions2/
Topic archived. No new replies allowed.