Ok this is a very simple program I am just making to play around.
but I ran into a problem, heres the code:
Code:
#include <stdio.h>
#include <unistd.h>
main()
{
char app[6];
printf("Type the name of the app you would like to open.\n");
scanf(" %s", app);
printf(" %s\n", app);
system("open -a %s.app", app);
return 0;
}
if you don't know about the unistd.h header don't worry that is not the problem. What happens is when I try to compile it says that there are too many arguments to function "system." However if I just make a program with everything the same but instead just get rid of the "%s" and put in itunes in the system command, it works... So I guess what I am asking is why is that and how can I fix it or write it correctly?