need alittle help

This is a discussion on need alittle help within the Linux Programming forums, part of the Platform Specific Boards category; i keep getting this error message.... sh: const: command not found in my code.... and i was wondering what can ...

  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, 03: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, 06:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21