It's error. What's wrong of my codes?
#include "stdafx.h"
#include "stdlib.h"
#include "ctype.h"
int _tmain(int argc, _TCHAR* argv[])
{
FILE* input;
int num;
int numCount = 0;
input = fopen("123.txt", "r");
if (!input)
{
printf("No file \a\n");
exit (101);
}
while ((fscanf(input, "%d", &num)) == 1)
printf("%d", num);
if (isdigit(input))
numCount++;
printf("number count: %d", numCount);
return 0;
} And what kind of an error are you encountering with, compiler error or runtime error, or maybe it's not working the way you wanted it to? These might help you get some answers
以上就是[C Program] How to count the numbers of digit from a file ?的详细内容,更多请关注web前端其它相关文章!