getw() in C language
getw( ) function in C, is basically used in file handling for reading an integer value from the file.
Through this article we will be going to discuss getw( ) function of C in detail in which we will cover following topics.
- gettw( ) function in c
- header file for getw( ) function in c
- return value of getw( ) function in c
- getw( ) function in c syntax
- getw( ) function in c program
getw( ) function in C
The getw( ) function is nothing but, it is a standard library function of C and it also called file handling function which is basically used to read an integer value from the stream(file).
Header file for getw( ) function in C
This file function is define in <stdio.h> which is stand for standard input-output header file.
Return value of getw( ) function in C
getw( ) function return an integer written to the file on success and if error occur than it returns End of File(EOF).
Syntax of getw( ) function in C
int fgetw(FILE *pointer):
Example of getw( ) function in C
#include<stdio.h>
#include<stdlib.h>
int main()
{
FILE *fptr;
int value;
fptr=fopen("num.dat","rb");
while((value=getw(fptr))!=EOF)
printf("%d\t",value);
fclose(fptr);
return 0;
}
____________________________________
____________________________________
Conclusion
The getw( ) function is basically used in file handling to read integer value from the file.

