Re: How to pass multi-dimensional array?
- From: James Kuyper <jameskuyper@xxxxxxxxxxx>
- Date: Sat, 27 Oct 2007 03:45:28 GMT
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.
.
- Follow-Ups:
- Re: How to pass multi-dimensional array?
- From: Charlie Gordon
- Re: How to pass multi-dimensional array?
- References:
- How to pass multi-dimensional array?
- From: Why Tea
- Re: How to pass multi-dimensional array?
- From: zhengcao . jin
- Re: How to pass multi-dimensional array?
- From: Charlie Gordon
- Re: How to pass multi-dimensional array?
- From: Keith Thompson
- Re: How to pass multi-dimensional array?
- From: pete
- How to pass multi-dimensional array?
- Prev by Date: Re: Dev-C++ compiling problem
- Next by Date: Re: Linked lists
- Previous by thread: Re: How to pass multi-dimensional array?
- Next by thread: Re: How to pass multi-dimensional array?
- Index(es):
Relevant Pages
|