डाउनलोड पी.डी.एफ. ई-बुक्स
C - Getw And Putw

विवरण :

कोई विवरण नहीं है |


सोर्स कोड :

#include<stdio.h>
#include<conio.h>

int main()
{
int i, num;
FILE *fptr;

fptr=fopen("File.txt","w");

for(i=1;i<=10;i++)
{
putw(i,fptr); // write integers to Opened file
}
fclose(fptr);

fptr=fopen("File.txt","r");

while((num = getw(fptr))!= EOF){  // read integers to Opened file
printf("%d\n", num);
}
fclose(fptr);

return 0;
}

आउटपुट :

1
2
3
4
5
6
7
8
9
10


All Numbers are stored in File.txt