Thread: in function 'main'

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    3

    Question in function 'main'

    $ cat shell.c
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    void sh(char *);
    int main()
    {
    void sh(char *cmd)
    int num;
    num = system(cmd);
    }

    $ gcc shell.c
    shell.c: In function `sh':
    shell.c:9: parse error before "num"
    shell.c:8: parm types given both in parmlist and separately
    $
    What do I do to correct this error??
    Last edited by zmonc; 06-12-2003 at 03:33 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM