C++ examples for Data Type:char array
Inputs and outputs strings with gets_s and puts
#include <iostream> using namespace std; #include <stdio.h> #include <string.h> void main()//ww w .j av a 2 s . c o m { char book[30]; cout << "What is the book title? "; gets_s(book); // Get an input string. puts(book); // Display the string. cout << "Thanks for the book!\n"; return; }