Thread: need alittle help

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    227

    need alittle help

    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);

    }

  2. #2
    Registered User alex's Avatar
    Join Date
    Sep 2001
    Posts
    132
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alittle help for a beginner please...
    By Xeavor in forum C++ Programming
    Replies: 23
    Last Post: 09-24-2004, 02:10 AM
  2. Noobie <-- alittle help /w compiler
    By Bean0578 in forum C++ Programming
    Replies: 4
    Last Post: 08-28-2004, 09:22 PM
  3. Alittle help please
    By boontune in forum C++ Programming
    Replies: 13
    Last Post: 12-10-2002, 04:41 PM
  4. alittle help please
    By boontune in forum C++ Programming
    Replies: 3
    Last Post: 10-02-2002, 04:21 PM
  5. Please alittle help-- if/else
    By jill in forum C++ Programming
    Replies: 5
    Last Post: 11-11-2001, 07:13 PM