Outputting Strings

Explore how to output strings to the console in C.

The puts() function

puts( ) is used to print strings. It is more effective than printf( ), as printf( ) is capable of printing things other than strings as well; hence, it is likely to work slower.

The basic syntax of the puts() function is given below:

void puts(const char *str);

Here, str points to the target string.

Get hands-on with 1400+ tech skills courses.