Works for me.
Code:
#include <stdio.h>
#include <string.h>
struct prod {
int height;
char name[5];
};
int main(int argc, char *argv[]){
int i, j ;
struct prod word[5] ;
struct prod wordcopy[5] ;
for (i = 0 ; i < 5 ; i++) {
word[i].height = i+1 ;
strcpy(word[i].name,"Dino") ;
}
for (i = 4, j = 0 ; i >= 0 ; i--, j++ ) {
wordcopy[i] = word[j] ;
}
for (i = 0 ; i < 5 ; i++) {
printf( "height: word=%d, wordcopy=%d\n", word[i].height, wordcopy[i].height) ;
printf( "name : word=%s, wordcopy=%s\n", word[i].name, wordcopy[i].name) ;
}
return 0;
}