Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!steinmetz!dawn!stpeters From: stpeters@dawn.steinmetz (Dick St.Peters) Newsgroups: comp.unix.wizards Subject: Re: have I found a bug in K&R? Message-ID: <7608@steinmetz.steinmetz.UUCP> Date: Mon, 12-Oct-87 15:11:05 EDT Article-I.D.: steinmet.7608 Posted: Mon Oct 12 15:11:05 1987 Date-Received: Wed, 14-Oct-87 00:37:49 EDT References: <517@hubcap.UUCP> <321@laticorp.UUCP> Sender: root@steinmetz.steinmetz.UUCP Reply-To: dawn!stpeters@steinmetz.UUCP (Dick St.Peters) Organization: General Electric CRD, Schenectady, NY Lines: 20 Keywords: argv definition In article <321@laticorp.UUCP> sarah@laticorp.UUCP (Sarah Groves Hobart) writes: >Remember that the following declarations are equivalent: > >char s[]; > >char *s; Actually, they're not. The difference is like that between a constant and a variable: you can change the value of s (the address it points to) if you declare it as a pointer [variable], but you can't if you declare it as an array [constant]. Consider what "&s" means in the two cases. -- Dick St.Peters GE Corporate R&D, Schenectady, NY stpeters@ge-crd.arpa uunet!steinmetz!stpeters