home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utoday!jaflrn!jaf
- From: Jon Freivald <jaf@jaflrn.UUCP>
- Newsgroups: comp.lang.c
- Subject: Re: Command Line Arguments
- Message-ID: <6o6yqB1w164w@jaflrn.UUCP>
- Date: Sat, 12 Sep 92 02:11:04 EDT
- References: <18intpINNif6@usenet.INS.CWRU.Edu>
- Organization: The Wizzard's Cave, East Meadow, NY
- Lines: 35
-
- bx314@cleveland.Freenet.Edu (Joseph J. Gebis) writes:
-
- >
- > I would like to know how to pass command line arguments in DOS
- > to a separate function... I would greatly appreciate if someone
- > would write an example of a program that passes command line arguments
- > to a separate function that then prints them on screen.
- >
- > Remember, I'm self-taught, and a beginner, so speak slowly
- > and loudly. :)
- > Thank you very much.
-
- #include <stdio.h>
-
- int main ( int argc, char **argv )
-
- {
- int i;
-
- for ( i=0 ; i < argc ; i++ )
- {
- show_me(argv[i]);
- }
- }
-
- void show_me (char *argv_i)
-
- {
- printf ("Arg: %s", argv_i);
- }
-
- =============================================================================
- Jon Freivald ( jaflrn!jaf@uunet.UU.NET )
- Nothing is impossible for the man who doesn't have to do it.
- =============================================================================
-