puts()

Declaration

int puts(const char *kcpString);

Description:

This function outputs a null-terminated string to the standard output stream "stdout." The final null character '' is replaced by an endline '\ ' in the output stream. The function returns a nonnegative value if successful and a negative value if the function call fails.

Example

#include <cstdio>

int main()
{
    // Write to stdout.
    int iRet = puts("Write a string to stdout");

    // Check whether or not some characters were written
    if (iRet == EOF) {
        perror("puts() call failed");
    }

    return 0;
}

Output:

puts() Output