So i have been using this function for codechef problems for quite some while now as a fast input method for integers.
My question is how this actually works,what is fgetc_unlocked(stdin) (even though its commented) and most importantly how can I optimise it to run for long and long long.
Here is the code:
inline void Scan_f(int a)
{
char c = 0;
while(c<33)//shouldn't value of c to compare be less than 9 as digit vary between 0 to 9??
//c = fgetc_unlocked(stdin);
c = getc(stdin);
a = 0;
while(c>33)
{
a = a*10 + c - '0';
//c = fgetc_unlocked(stdin);
c = getc(stdin);
}