From owner-freebsd-questions Tue Feb 3 14:59:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA22745 for questions-outgoing; Tue, 3 Feb 1998 14:59:00 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from hil-img-1.compuserve.com (hil-img-1.compuserve.com [149.174.177.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA22738 for ; Tue, 3 Feb 1998 14:58:56 -0800 (PST) (envelope-from Malcolm_Boff@compuserve.com) Received: (from mailgate@localhost) by hil-img-1.compuserve.com (8.8.6/8.8.6/2.10) id RAA19100; Tue, 3 Feb 1998 17:58:19 -0500 (EST) Date: Tue, 3 Feb 1998 17:57:06 -0500 From: MALCOLM BOFF Subject: RE: Can't getopt() To: grobin Cc: freebsd Message-ID: <199802031758_MC2-31CC-D2E8@compuserve.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.freebsd.org id OAA22740 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe questions" The standard 'main()' for a C program is :- int main(int argc, char **argv) { main code ... } Now argc and argv are correctly declared ... I also suspect that the format that you specified is not really what you want since this will treat each letter as a flag (ie -a -b -c etc) If you want to be able to pick up something like a file name following a -f flag then follow the letter with a colon (:) and use a switch() statement on the result of getopt(). Malcolm G. Boff Sylmex Ltd.