I want to make a C-RAM simulator and I need to manipulate strings, so I would like to use a 4x4 array to input 4 memory locations with 4 bits: 1010 1000 1011 0000 Something like that.
#include<Stdio.h>
void main(){
char array[4][5];
printf("Informe as 4 posicoes:\n");
int i;
//leitura
for(i=0;i<4;i++){
scanf("%s", array[i]);
}
//impressão
printf("Imprimindo!\n");
for(i=0;i<4;i++){
printf("%s\n", array[i]);
}
}
But the impression of this array is going to be a bit confusing. if I change array [4] [4] to array [4] [5] the print will be normal.