Hello I have this code that fills the array with a pointer and print it with a pointer as well. The result is faulse. Here is my code:
#include<stdio.h>
#include<stdlib.h>
int main(){
int p;
char po[8];
char *i;
i=po;
for(p=0; p<8; p++){
scanf("%c\n", i++);
}
for(p=0; p<8; p++){
printf("%c\n", *(i++));
}
return 0;
}
where is my fault?
scanf("%c\n", i++);...please don't write this sort of code.