Jul 16, 2013 at 10:13pm UTC
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?
Jul 16, 2013 at 10:16pm UTC
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 Jul 16, 2013 at 10:17pm UTC
Jul 16, 2013 at 10:18pm UTC
What do I do with that code? Will it take away my errors?
Jul 16, 2013 at 10:22pm UTC
Yes provided you have declared the variables argc and args
Jul 16, 2013 at 10:26pm UTC
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 Jul 16, 2013 at 10:28pm UTC
Jul 16, 2013 at 11:46pm UTC
I do know some stuff, I just have never messed with the () after main or void or whatever. What's my solution vlad?
Jul 17, 2013 at 12:08am UTC
Just how can I call this function?