C Programming/stdio.h/wscanf

wscanf

wscanf is a standard C library function in C programming language. It transforms wide character input. This function is supported by the header file wchar.h. wscanf is wide character version of scanf.

Syntax It returns count of inputs which are properly formatted. Count may be zero or less than the entered inputs in case of unformatted wide character input.

example

Now if the given input is like as given below: 83 56.6 k m Scanf input 54 22.3 a f Wscanf input

then output will be like this: The number of fields input is 6 The contents are: 83 56.599998 k m Scanf input The number of fields input is 6 The contents are: 54 22.300003 a f Wscanf input Thus scanf returns no of fields which are properly formatted or in another words which are successfully assigned.it does not does not returns the count for the field which is not properly formatted and such values are read but not assigned. And EOF is returned if end of the file character is encountered in first character reading of the file. Reference