|
|
Tutorials

Cpp

|
Topic |
How is "puts()" used in C++?
|
|
Explanation |
|
puts() is an I/O function that is used to write a string to the standard output. This function returns a non negative value upon
if successfull and returns EOF otherwise.
Syntax:
int puts(const char *str);
Example:
#include <stdio.h>
int main ()
{
char str [] = "ABCD";
puts (str);
}
|
Result:
ABCD
In the above example puts() is used to write the string of an array to the standard output.
|
| Note |
C++ is one of the most used programming languages in the world. Also known as "C with Classes".
Hope you enjoy this tutorial. Do send your feedback or suggestions on this C++ tutorial. This is a copyright content.
|
|
|
|