what data type can be used for entering string in c++.after declaration i am going to use cin | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what data type can be used for entering string in c++.after declaration i am going to use cin

8th Oct 2018, 1:14 PM
lakshay
2 Answers
0
you can use traditional char array, which the characters is limited to its size char str[10]; or std::string, std::string itself is a class representing a sequences of characters std::string str; //example std::string input; std::cin>>input; //or char input[10]; // can hold 9 characters std::cin>>input
8th Oct 2018, 1:41 PM
Taste
Taste - avatar
0
what is tge syntax? pls give me a program as ecample
10th Oct 2018, 11:38 AM
lakshay