Whats the difference between the 2 following prototypes?
Code:void VIDE_do_anim_lists(size_t n, struct DATA_LIST *Lists[n]); void VIDE_do_anim_lists(size_t n, struct DATA_LIST *Lists[]);
This is a discussion on C99 feature within the C Programming forums, part of the General Programming Boards category; Whats the difference between the 2 following prototypes? Code: void VIDE_do_anim_lists(size_t n, struct DATA_LIST *Lists[n]); void VIDE_do_anim_lists(size_t n, struct DATA_LIST ...
Whats the difference between the 2 following prototypes?
Code:void VIDE_do_anim_lists(size_t n, struct DATA_LIST *Lists[n]); void VIDE_do_anim_lists(size_t n, struct DATA_LIST *Lists[]);
The former, which is only allowed in C99, is indicating the size of the array being passed in. It does not in any way GUARANTEE this size - but it indicates that the size is the same as n.
The latter form, obviously, does not indicate anything about the size of the array.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.