When I run this program, and the file can be found, it works fine. However when the file is not there I get the error:
Debug Assertion Failed!
Expression (str != NULL)
It seems to be a problem with the following loop as when its remove it works fine:
FILE *fp; fp=fopen("texts.txt","r"); if (fp == NULL) printf("Can't open file!\n"); else printf("File opened!\n"); fclose;