C Programming Code Examples C > Strings Code Examples Read & Write Strings in C using gets() and puts() functions Read & Write Strings in C using gets() and puts() functions String is an array of characters. In this guide, we learn how to declare strings, how to work with strings in C programming and how to use the pre-defined string handling functions. We will see how to compare two strings, concatenate strings, copy one string to another & perform various string manipulation operations. We can perform such operations using the pre-defined functions of "string.h" header file. In order to use these string functions you must include string.h file in your C program. #include <stdio.h> #include <string.h> int main() { /* String Declaration*/ char nickname[20]; /* Console display using puts */ puts("Enter your Nick name:"); /*Input using gets*/ gets(nickname); puts(nickname); return 0; }