How to interpret read codes

Can Someone help me how to read/understand this part of the code. The one that's in red. Thank you. :slight_smile:

[code] while ((n = rdfile.fgets(line, sizeof(line))) > 0) {

int line; [/code]

 void rateOne() {
char line[10];
int n;

// open test file
SdFile rdfile("test.txt", O_RDONLY);

// check for open error
if (!rdfile.isOpen()) {
 lcd.print ("error"); 

}

while ((n = rdfile.fgets(line, sizeof(line))) > 0) {

   int line; [code]

(post deleted by author)

to0n7:

You should use /code to end your code tag

Tnx :slight_smile:

Help you understand the ravings of a mad person?

That's the code equivalent of a Trump press conference.

while ((n = rdfile.fgets(line, sizeof(line))) > 0) {

fgets() is called to read a string a line of text. fgets returns the number of characters read and setting "n" to that value, "n =". the condition "> 0" is true and the while continue to execute as long as one or more characters are read. fgets() returns EOF (-1) at the end of the file

...and then there's the new "line".

That's just confusing.