create a string of length n with input a in c++ code example Example: how to print string data type in c++ printf("%s\n",someString.c_str());