fscanf with while loop
assume $num
is the number what you assign through scanf or fscanf or sscanf and so on.
while (fscanf(fileptr, formatstring, &var1, &var2,...)!=$num) {
//do some thing.
}
fclose(fileptr);
if you encounter invalid pointer, check memory and pointer operation anywhere first.
because i have written this template but still stuck with invalid pointer
. i found other pointer operation error finally.
本文来自博客园,作者:ijpq,转载请注明原文链接:https://www.cnblogs.com/ijpq/p/15428304.html