I need to count characters from a file. But I get an error error C2660: 'getchar' : function does not take 1 arguments.
Im new to C please bare with me.
Thanks for your help.
#include "stdafx.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
int _tmain(int argc, _TCHAR* argv[])
{
int ch ;
int count = 0;
FILE *fin,*fout;
fout = fopen("m:/cop1220/wordin.txt","w");
fin = fopen("m:/cop1220/wordin.txt","r");
//ch=getchar();
//fscanf(fin,"%c",&ch);
while ((ch = getchar(fin)) != EOF)
count ++ ;
printf( "%d characters\n" , count ) ;
system("pause");
return 0;
}