Syntax
#include <conio.h> int _cscanf(char *format-string, argument-list);Description
The format-string controls the interpretation of the input fields and has the same form and function as the format-string argument for the scanf function. See scanf for a description of the format-string.
Note: Although _cscanf normally echoes the input character, it does not do so if the last action was a call to _ungetch.
The return value is EOF for an attempt to read at the end of the file. A return value of 0 means that no fields were assigned.
This example uses _cscanf to read strings from the screen.
#include <conio.h> int main(void) { char buffer[24]; _cprintf("\nPlease enter a filename:\n"); _cscanf("%23s", buffer); _cprintf("\nThe file name you entered was %23s.", buffer); return 0; /**************************************************************************** The output should be similar to : Please enter a filename: file.dat The filename you entered was file.dat. ****************************************************************************/ }Related Information