C Programming Code Examples C > Strings Code Examples Read & write Strings in C using Printf() and Scanf() functions Read & write Strings in C using Printf() and Scanf() 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]; printf("Enter your Nick name:"); /* I am reading the input string and storing it in nickname Array name alone works as a base address of array so we can use nickname instead of &nickname here */ scanf("%s", nickname); /*Displaying String*/ printf("%s",nickname); return 0; }