Mail Archives: djgpp/1997/06/13/11:33:08
Tony O'Bryan wrote:
>
> Maybe I misunderstood what you said, but gcc reports no errors with this program
> compiled with "gcc -Wall test.c":
>
> int *Func1(int *Pointer)
> {
> Pointer += 5;
[snip]
>
> int *Func2(int Pointer[])
> {
> Pointer += 5;
[snip]
According to my C reference and my understanding of the language, when
you specify empty brackets for an array-type variable in an argument
list, the compiler handles the variable identically to one explicitly
defined as a pointer. In essence, *[] and ** have identical
functionality. A little bird once told me that *argv[] was not 100%
portable; however, I've never seen a problem with it.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| Proud owner of what might one | http://www.cs.com/fighteer |
| day be a spectacular MUD... | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------
- Raw text -