Question: Why must getline() be used insteadof cin to get string input? Give an example of when you would need touse cin.ignore() in your code Strings
- Why must getline() be used insteadof cin to get string input?
- Give an example of when you would need touse cin.ignore() in your code
- Strings in C++ are mutable, this is different than in Javawhere strings were immutable. What do we mean by mutableversus immutable?
- Imagine your code had the following string variable init string message ="HH231JJ"; Write a for loop that uses the [ ]operator to change each 'H' character in the message string toa '#' character.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
