From owner-freebsd-questions Tue Feb 3 13:11:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA04101 for questions-outgoing; Tue, 3 Feb 1998 13:11:17 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA04095 for ; Tue, 3 Feb 1998 13:11:12 -0800 (PST) (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.7/8.8.8) with SMTP id NAA13560; Tue, 3 Feb 1998 13:10:52 -0800 (PST) (envelope-from dwhite@gdi.uoregon.edu) Date: Tue, 3 Feb 1998 13:10:52 -0800 (PST) From: Doug White Reply-To: Doug White To: Geoffrey Robinson cc: questions@FreeBSD.ORG Subject: Re: Can't getopt(). In-Reply-To: <34D6150D.2FD35180@accessv.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe questions" On Mon, 2 Feb 1998, Geoffrey Robinson wrote: > The program below should print the first command line argument but when > I try to compile it I get the errors 'argc' undeclared and 'argv' > undeclared. Forget your C text? :) > main() The proper declaration should be void main(int argc, char** argv) argc is the number of arguments, argv is the string of arguments. change void to int and return(0) at the end if you want to be all proper UNIXlike. Doug White | University of Oregon Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant http://gladstone.uoregon.edu/~dwhite | Computer Science Major