So i have this problem in c++.
I open a file and read it char by char and print it on screen.
It works fine until I add this to the program.
gr=0; The complete program:
int main() { int gr; char *ch; gr=0;//this causes the problem FILE *fp; fp=fopen("as.txt","r"); do { *ch=fgetc(fp); cout<<*ch<<endl; } while (*ch!=EOF); }