paxdiablo gave the previous answer for it working with char array.. can I know how to work with int array for the same below code?
LIke:
struct encode {
int code[MAX]; //instead char code[MAX]
} a[10];
int main() {
int i, j;
int x[] = {3,0,2,5,9,3,1};
//instead char x[] = {'3','0','2','5','9','3','1','\0'};
for(i = 0; i < 1; i++) {
for(j = 0; j < 7; j++) {
printf("%d", x[j]);
}
printf("\n");
a[0].code=x;
//strcpy(a[0].code, x); for char
}
printf("%d\n",a[0].code);
//printf("%s\n",a[0].code); for char
return 0;
}
Like show can this be done for int array? Thanks in advance.