??? 11/10/11 15:19 Read: times |
#184614 - Always good to hide black-box data in structs Responding to: ???'s previous message |
Erik Malund said:
why the "struct of an array"?
a struct whith one entry does not make sense to me I have seen such before, if anyone has a valid reason for such, pray tell. Erik A struct always makes sense if you want to give a data type for creation of variables without the main part of the program knowing about what the variable is really storing. For a data type "int", "char" etc, the data type could have been just that. But arrays are always problematic - you do not want your "black-box" variables to be an array. Remember that an array in itself is a pointer, so what is p++ when p is a pointer to an array of 4 bytes, instead of a pointer to a struct containing an array of four bytes? |