Item | Value |
Header file | stdio.h |
Declaration | int puts(const char *str); |
Function | writes the string to the standard output device. The null terminator is translated to a newline. |
Return | returns a nonnegative value on success or an EOF upon failure. |
#include <stdio.h> #include <string.h> int main(void) { char str[80]; strcpy(str, "this is an example"); puts(str); return 0; }
this is an example
22.27.puts | ||||
22.27.1. | puts | |||
22.27.2. | puts() function is a simplified version of the printf() function. | |||
22.27.3. | puts() can print variables |