Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!news.arc.nasa.gov!ucsd!hub.ucsb.edu!angst From: angst@cs.ucsb.edu (Hopelessly in love w/Donna Reed) Newsgroups: comp.lang.c Subject: argv[] terminated by a NULL pointer? Message-ID: <12187@hub.ucsb.edu> Date: 23 Jun 91 00:48:30 GMT Sender: news@hub.ucsb.edu Reply-To: angst@cs.ucsb.edu (Hopelessly in love w/Donna Reed) Organization: Funf auf def nach oben offenen Richterskala Lines: 22 [I looked in the FAQ and this wasn't mentioned.] I'm porting some code that assumes that the argv[] array is terminated by a NULL pointer, rather than just using argc to determine the number of arguments passed to the program. I was always taught to use argc, and was of the belief that argv[] is not necessarily terminated by a NULL pointer. The only reason I can come up with for people thinking that it is terminated with a NULL pointer is the calling syntax for the the different forms of exec, which require the argument array to be terminated by a NULL. So I guess my question is: am I right in my belief that argv[] is not *guaranteed* to be terminated by a NULL pointer? Thanks. "Let the fools have their tartar sauce." | Dave Stein - Mr. Burns | angst@cs.ucsb.edu | angst%cs@ucsbuxa.bitnet