Syntax
#include <conio.h> int _cprintf(char *format-string, argument-list);Description
The format-string has the same form and function as the format-string parameter for printf. Format specifications in the format-string determine the output format for any argument-list that follows. See printf for a description of the format-string.
Note: Unlike the fprintf and printf functions, _cprintf does not translate line feed characters into output of a carriage return followed by a line feed.
The following program uses _cprintf to write strings to 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