Text File

Aucbvax.5447 fa.unix-wizards utzoo!decvax!ucbvax!unix-wizards Fri Dec 11 17:36:29 1981 char foo[] = bar; >From ihnss!cbosg!cbosgd!mark@Berkeley Fri Dec 11 17:29:38 1981 If you think about what the compiler has to do, you'll understand this. char foo[] = "bar" will make foo an array of 4 characters, and the address of foo will be the address of the first character. char *foo = "bar" will cause foo to be a pointer to some memory initialized as "bar\0", and the address of foo will be the address of that pointer. The compiler tries to be smart about treating the two the same, as far as parameter passing goes, but if the two modules are compiled separately it has no way to tell which way the storage was allocated in the other module.

----------------------------------------------------------------- gopher://quux.org/ conversion by John Goerzen <jgoerzen@complete.org> 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.