I'm building an assembly compiler in C, and I need to print only line which contain code (alphanumeric characters).
However my compiler doesn't recognize a string pointed to by fgets()
as empty, since it sometimes contains whitespace characters.
How do I make a condition, to only print lines containing alphanumeric characters?
My code looks like this:
while(fgets(Line,256,Inputfile)!=NULL)
{
i=0;
while(Line[i]!='\n')
{
Instruction[i]=Line[i];
i++;
}
printf("%s \n",Instruction);
}
Thanks,