Forum Discussion
Altera_Forum
Honored Contributor
15 years agoIOWR and IORD with PIOs
I have a basic question concerning PIOs. Currently, I am sending 4 8-bit integers over 4 ouput PIOs from NIOS to hardware to do a calculation on them and return another 8-bit integer value. This is a...
Altera_Forum
Honored Contributor
15 years agoPointers and arrays are *almost* the same thing in C.
&(small_1) == ??? // something that ain't what you want. (pointer to a pointer to an array?) &(small_1[0]) == small_1 // small_1 without an index is a pointer to the zero'th item in the array. The [] does much the same thing that the & un-does. also, (small_1+0), (small_1+1), etc. point to individual items in the array, regardless of the size of the items ...so there isn't any need to create a new variable. Try just going ALT_CI_MYMACRO((void *)small_1, ... if you *really* want, you can probably use &(small_1[]), or &(small_1[0]) instead of small_1 to make a point, but that's unnecessary. Then you would have (void *) &(small_1[?])... Array, pointerize, typecast ... whew! Sort of like if (!!!true!=!false)... // what? besides, your new variables are pointers to alt_u8, not arrays of alt_u8 (it's different). You eventually typecast to void* (so who cares?), but it's still bad form.