oh okay XD apologies... its possible to use them without using break commands.
functions that read text from notepad have an EOF (End Of File). EOF denotes that the notepad has been read until the final part. no more text to read. we utilize this condition in the 'while' loop so it can terminate itself without using break commands.
for example,
1 2 3
while (fscanf(fp, "%s", str)!=EOF)
//or
while (fgets(str, 128, fp)!=NULL)
note that these functions are for C, and there are more advanced functions for C++. also, as you'd probably see, the end for fscanf is EOF, while fgets is NULL. different functions have different way of telling that there is no more text to be read.