Function puts () in C
The function int puts (const char * str) in the standard C library writes a str string to stdout (not writing null characters). A newline character (new line) is appended to the output.
The function int puts (const char * str) in the standard C library writes a str string to stdout (not writing null characters). A newline character (new line) is appended to the output.
Declaring the function puts () in C
Here is the declaration for function puts () in C:
int puts ( const char * str )
Parameters
str - This is the string to be written.
Returns the value
If successful, this function returns a non-negative value. If there is an error, the function returns EOF.
For example
Program C then illustrates the usage of functions puts () in C:
#include #include int main () { char str1 [ 15 ]; char str2 [ 15 ]; strcpy ( str1 , "QTMteam" ); strcpy ( str2 , "xinchaocacban" ); puts ( str1 ); puts ( str2 ); return ( 0 ); }
Compile and run the above C program to see the results.
According to Tutorialspoint
Previous lesson: putchar () function in C
Next lesson: Function ungetc () in C
You should read it
Maybe you are interested
The whole scene of meteorites hitting the Earth during the past 33 years, why can't we feel it? Discovered mysterious signals emanating from a star right next to the Solar System, possibly of aliens NASA reveals its latest snapshot of the Martian surface with a resolution of 1.8 billion pixels Found the second planet of Proxima Centauri, the star closest to the sun 7 most modern astronaut ships on the planet Is Proxima b our 'neighbor' planet?