I wrote this code and have a pointer that I want to point to another character array of arrays. But it says
Code:
:24: error: incompatible types in assignment
here is my code
Code:
#include <stdio.h>
#define SIZE 3
char array[SIZE+4][SIZE+2];
char *view[SIZE+4];
void input(void){
int x;
for(x=0;x<SIZE;x++){
fgets(&array[x][2],sizeof(array[x]),stdin);
};
}
void print(void){
int x;
for(x=0;x<SIZE;x++){
printf("%s\n",array[x]);
}
}
int main(void){
int x,y;
input();
view=array;
for(y=0;y<SIZE+2;y++){
array[SIZE+3][y]='\0';
array[0][y]='\0';
}
for(x=0;x<SIZE+4;x++){
array[x][0]='\0';
array[x][SIZE+1]='\0';
}
for(x=1;x<SIZE+1;y++){
view[x][1]=array[x][SIZE+1];
view[x][SIZE+2]=array[x][1];
}
print();
return 0;
}