Simple hex to ascii char conversion
Hello, I've written a program that takes a file of hex values, and converts it into characters. I'll end up using(running linux)./byte2char < hexvalues.txt > newvalues.txt to do the conversion. The thing is, it works perfectly, it's just the loop won't end. I run it, and I have to stop it manually with ctrl+c. After only about half a second of running, I'll end up with the converted text and then about 2 million extra lines of nothing. Any help please?
Thanks
Code:
#include<stdio.h>
int main()
{
char c;
char x;
while (c!= EOF)
{
scanf("%x",&c);
printf("%c",c);
}
return 0;
}