same syntax for using pointers and arrays

John Gilmore gnu at l5.uucp
Sat Sep 14 19:34:35 AEST 1985


I've converted several C programs from having fixed buffers allocated
at compile time, to malloc-ing their buffers at run time, and the
change was almost always trivial, since you could turn a global array
into a global pointer and change few if any other lines of source.
This would be a pain in most other languages.  I've done this to tar's
tape block size at Sun and just did it to the terminal screen size in
2.10.3 vnews.

*I think it's a great feature* although I wish they hadn't let you
declare a function parameter as an array and then treated it as a
pointer, since there definitely ARE differences.  Maybe that can be a
"commonly available extension" to the ANSI standard, rather than
standardizing it that way?



More information about the Comp.unix.wizards mailing list