0
Do boolean statements get executed or just evaluated?
Sorry if the title is not very clear. Thing is; suppose I have a while loop that reads a string from a file and stores it into an array with fscanf. Clearly, I need this loop to be executed until fscanf returns EOF. The thing is, if my code says something like while (fscanf(file, "%s", array) != EOF) will the statement be actually executed? That is, will fscanf read the file and copy a string into the array, or will it just verify if it returns EOF and proceed to execute the branch within {}? Thanks in advance
1 Answer
+ 2
First it will read the string into array, then fscanf returns the number of items or variables filled or read..