Aucbvax.5439 fa.unix-wizards utzoo!decvax!ucbvax!unix-wizards Fri Dec 11 04:18:10 1981 char foo[] vs char *foo >From tjt@mit-vax@mit-xx Fri Dec 11 04:11:58 1981 The only time when char foo[] is equivalent to char *foo is as parameters of a function. char foo[] declares foo as an array of characters of unspecified size. The size of the array is determined by the initialization string "bar". However, in the context of declaring function arguments, array types are converted to pointers, thus promoting the popular fiction that the above two declarations are equivalent. Reference: "C Reference Manual" in "The C Programming Language". Section 8.4 pp194-5 and Section 10.1 pp204-5. ----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen of http://communication.ucsd.edu/A-News/ This Usenet Oldnews Archive article may be copied and distributed freely, provided: 1. There is no money collected for the text(s) of the articles. 2. The following notice remains appended to each copy: The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996 Bruce Jones, Henry Spencer, David Wiseman.