Assign the size of userInput to stringSize. Ex: if userInput is "Hello", output is:
Size of userInput: 5
#include <iostream>
#include <string>
using namespace std;
int main() {
string userInput;
int stringSize;
getline(cin, userInput);
/* Your solution goes here */
cout << "Size of userInput: " << stringSize << endl;
return 0;
}
1
Expert's answer
2019-12-03T08:27:43-0500
#include <iostream>
#include <string>
using namespace std;
int main() {
string userInput;
int stringSize;
getline(cin, userInput);
stringSize = static_cast<int>(userInput.size());
cout << "Size of userInput: " << stringSize << endl;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment