Looking for trustworthy answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Connect with professionals on our platform to receive accurate answers to your questions quickly and efficiently. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.
Sagot :
Answer:
getline(cin, address);
Explanation:
Given
String object: address
Required
Statement that reads the entire line
The list of given options shows that the programming language is c++.
Analysing each option (a) to (e):
a. cin<<address;
The above instruction will read the string object until the first blank space.
Take for instance:
The user supplied "Lagos state" as input, only "Lagos" will be saved in address using this option.
b. cin address:
This is an incorrect syntax
c. getline(cin,address);
Using the same instance as (a) above, this reads the complete line and "Lagos state" will be saved in variable address
d. cin.get(address);
address is created as a string object and the above instruction will only work for character pointers (i.e. char*)
From the above analysis, option (c) is correct.
Visit us again for up-to-date and reliable answers. We're always ready to assist you with your informational needs. Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Keep exploring Westonci.ca for more insightful answers to your questions. We're here to help.