OK, now I think there might be a code error.. here is the output of the code...and then the code itself.. I am not sure what is going on.. it seems to me it should work.
ok heres the output to the console.. btw this is unix.
new-host:C programs Alex$ ./a.out
This program can open applications or delete files
Please select what you like to do
enter 'Delete' to delete files, or 'open' to open
open
Type in the name of the app
Unable to find application named '
.app'
new-host:C programs Alex$
ok and code
Code:
if(toupper(choice[0]) == 'O')
{
char empty1[25];
char empty2[55];
char applic[15];
char applic2[18];
printf("Type in the name of the app\n");
fflush(stdin);
fgets(applic, 15, stdin);
sprintf(applic2, "\"%s\"", applic);
sprintf(empty1, "open -a %s", applic2);
sprintf(empty2, "%s.app", empty1);
system(empty2);
}
PLEASE HELP :0
oh and btw w/o the fflush(stdin); it does the same thing