home *** CD-ROM | disk | FTP | other *** search
- From: jbc@hpcuhe.cup.hp.com (Jeff Caldwell)
- Date: Sat, 15 Aug 1992 01:17:25 GMT
- Subject: Re: How can a program know where it was invoked?
- Message-ID: <31460026@hpcuhe.cup.hp.com>
- Organization: Hewlett Packard, Cupertino
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!hpscdc!hplextra!hpcc05!hpcuhb!hpcuhe!jbc
- Newsgroups: comp.lang.c
- References: <1992Aug9.024844.6230@debbie.cc.nctu.edu.tw>
- Lines: 14
-
- > > main(argc, argv)
- > > int argc;
- > > char *argv[];
- > > {
- > > char string[20];
- > > sprintf(&string, "which %s", argv[0]);
- > > system(string);
- > > }
- >
- > Also, the & in front of "string" is wrong.
-
- Oops. Obvious typo. Thanks for the correction.
-
- -Jeff Caldwell
-