Previous | Home | Next |
The gettw() function is used to read the integer from file.
This function return the integer value from the file associated with pointer fp1. it return the next integer from the input files on success and EOF on error.
#include<stdio.h>
void main()
{
FILE *fp1;
int a;
fp1=fopen("rajesh.dat","rb");
while((a=getw(fp1)!=EOF)) //Read integer form file
printf("%d\t",a);
fclose(fp1);
};
Output:This program read the integer from the file name "rajesh.dat"
1
2
3
4
5
6
7
8
9
10
Previous | Home | Next |