I have a simple question about using fgets() with char* string.
.... char *temp; FILE fp=fopen(\"test.txt\", \"r\"); fgets(temp, 500, fp); printf(\"%s\", te
char *temp is uninitialized, that is, it isn't pointing to valid memory. Either make it an array (char temp[]) or use malloc to assign memory for it.
char *temp
char temp[]
malloc