Re: How to pass multi-dimensional array?



pete wrote:
....
int matrix_check(int (*m)[10]) { ... }

I like the pointer notation for the parameter,
because that makes it more obvious what the parameter really is.

If I declared it the way you suggest, the compiler I use most frequently would insist on reminding me that I should declare 'm' to be const. It issues no such reminder when I use "int m[][10]", even though that's functionally equivalent to your declaration. I can't turn off that reminder without turning off other 'const'-related reminders that I actually find useful.

It's annoying how stupid things like that can affect your programming style.
.



Relevant Pages

  • Re: How to pass multi-dimensional array?
    ... If I declared it the way you suggest, the compiler I use most frequently ... would insist on reminding me that I should declare 'm' to be const. ... Does it suggest const because it determines the array is not modified in the ...
    (comp.lang.c)
  • Re: How to pass multi-dimensional array?
    ... I like the pointer notation for the parameter, ... would insist on reminding me that I should declare 'm' to be const. ...
    (comp.lang.c)
  • Re: How to pass multi-dimensional array?
    ... If I declared it the way you suggest, the compiler I use most frequently would insist on reminding me that I should declare 'm' to be const. ... This "remark" is generated because it determines that the pointer itself is not modified in the body of the function. ...
    (comp.lang.c)
  • Re: How to pass multi-dimensional array?
    ... frequently would insist on reminding me that I should declare 'm' ... Does it suggest const because it determines the array is not ... pointer itself is not modified in the body of the function. ... suggesting that I declare the pointer itself const, ...
    (comp.lang.c)
  • Re: Kick Starting AfterUpdate Event in another Form
    ... "Pete Halfacree" wrote in message ... although I will have to analyse my Process again. ... Declare>it< Public ..." ... >> end sub ...
    (microsoft.public.access.formscoding)