grepawk
New Coder
please can someone explain what this function does? and is it possible to code it more efficiently? I don't understand especially if
What I can see: it is loading only numbers from a text file and those numbers are being stored to a pointer on the array
Thanks in advance for any help
What I can see: it is loading only numbers from a text file and those numbers are being stored to a pointer on the array
C:
void LoadNumbers(int*pNumberArray,FILE*textFile) //---F7-
{
int i = 0;
while (fscanf(textFile,"%d", &pNumberArray) != EOF)
{
if (fscanf(textFile,"%*[^-+0-9]", &pNumberArray) == EOF) break;
else if (pNumberArray != 0 ){++i; pNumberArray = '\0';
}
}
Thanks in advance for any help
Last edited by a moderator: