vendredi 29 août 2014

How to loop a program with gets() and strlen?


Vote count:

0




I noticed a program is looping with this code:



char line[100];

while (gets(line), strlen(line)){//some stuff}


And the program loops until I hit enter without writting in the line... How does this work?


I already know gets() stores the current line and srtlen() returns the length of the string but... What makes this while loop? What are the functions of the gets() and strlen() in the while? and why there's a coma "," ?



asked 1 min ago







How to loop a program with gets() and strlen?

Aucun commentaire:

Enregistrer un commentaire