- #1
ineedhelpnow
- 651
- 0
Assign the size of userInput to stringSize. Ex: if userInput = "Hello", output is:
Size of userInput: 5Sample program:
help! i figured i have to use the function size() but not sure how in this case.
Size of userInput: 5Sample program:
Code:
#include <iostream>
#include <string>
using namespace std;
int main() {
string userInput;
int stringSize = 0;
userInput = "Hello";
<STUDENT CODE>
cout << "Size of userInput: " << stringSize << endl;
return 0;
}
help! i figured i have to use the function size() but not sure how in this case.