PDA

View Full Version : need alittle help



xlordt
02-14-2002, 04:03 AM
i keep getting this error message.... sh: const: command not found in my code.... and i was wondering what can i do to fix it...?

#include <stdio.h>
#include <stdlib.h>

int main()



{

int count;
system("const char *command");

for (count = 10 ; count > 0 ; count--)

{

printf("%i\n", count);

sleep(1);

}
system("start http://www.cyruslabs.com");
return (0);

}

alex
02-14-2002, 11:53 AM
Hi!

system("const char *command");

this command instructs the shell ("sh" in your case) to execute the command "const" with arguments "char" and "*command". Your shell cannot find the command "const", so it gives the error message "sh: const: command not found".

start with something like this:

const char *command="ls -la"
system(command);

alex