I am using '\t' to try and match tabs on the input, but it doesn't seem to work.
Any thoughts?
#include <stdio.h>
int main()
{
double n_tabs, n_newlines, n_blanks;
int nextChar = getchar();
while (nextChar != EOF)
{
if (nextChar == '\t') //Does not appear to work.
{
++n_tabs;
}
else if (nextChar == '\n')
{
++n_newlines;
}
else if (nextChar == ' ')
{
++n_blanks;
}
nextChar = getchar();
}
printf("# Tabs %d\n", n_tabs);
printf("# Newlines %d\n", n_newlines);
printf("# Blanks %d", n_blanks);
return 0;
}