integer array

Posted by Gohan_TheDragonball on Sat 30 Jun 2007 02:54 AM — 3 posts, 14,098 views.

USA #0
file misc.c:

//declared at top of file
int spaceused[200][5][5];

function nextLetter()

(line 2865) int spaces[200][5][5];
(line 2871) spaces = spaceused;
(line 2886) spaceused[wordcount] = spaces[num];

misc.c: In function `nextLetter':
misc.c:2871: incompatible types in assignment
misc.c:2886: incompatible types in assignment

can anybody tell me how i would get these operations done?
USA #1
You have to copy the entire array element by element. Arrays aren't objects that can be assigned back and forth.

You could try memcpy'ing the source to the destination, but you'd have to be careful -- and depend on the fact that on almost all implementations, arrays like that are allocated in a contiguous block.
USA #2
bah figures, appreciate the feedback, was hoping for an easy way to do it, not like a couple for-loops are all that hard but oh well.