home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!princeton!mccc!pjh
- From: pjh@mccc.edu (P. J. Holsberg)
- Newsgroups: comp.lang.c
- Subject: argv[] as a general purpose 2D array
- Message-ID: <BzKoLn.8BL@mccc.edu>
- Date: 20 Dec 92 19:24:57 GMT
- Organization: The College on the Other Side of U. S. 1
- Lines: 12
-
- Exam question asked that if the name of the file was not typed on the
- command line, the user should be prompted for it. Most set up a char
- array to hold the name of the file, and strcpy'd to it from argv[1] if
- the name was in argv[1].
-
- One student decided to save some memory space and scanf'd the prompted
- name directly to argv[1]!
-
- Are there any problems to that approach??
-
- Thanks,
- Pete
-