error coding Input/Output in functions in C
hi,
this is a code for the Input/Output in c:
include <stdio.h>
main()
{
FILE *fs;
char ch;
int nol = 0; not = 0, nos = 0, noc = 0, nob = 0;
fs=fopen("PR1.C","r");
while(1)
{
ch=fgetc(fs);
if(ch==EOF)
break;
noc++;
if(ch=='')
nob++;
if(ch=='\n')
nol++;
if(ch=='\t')
not++;
}
fclose(fs);
printf(" Number of characters=%d\n",noc);
printf(" Number of blanks=%d\n",nob);
printf(" Number of tabs=%d\n",not);
printf(" Number of lines=%d\n",nol);
}
and this is the compilation error:
[root@localhost i-o]# gcc -o l330 l330.c
l330.c: In function `main':
l330.c:6: error: `not' undeclared (first use in this function)
l330.c:6: error: (Each undeclared identifier is reported only once
l330.c:6: error: for each function it appears in.)
l330.c:6: error: `nos' undeclared (first use in this function)
l330.c:6: error: `noc' undeclared (first use in this function)
l330.c:6: error: `nob' undeclared (first use in this function)
l330.c:19:13: empty character constant
plz point me the mistake.
|