Simply write the correct code statements for the question below: -Write a statem
ID: 3631906 • Letter: S
Question
Simply write the correct code statements for the question below:
-Write a statement to declare a vector of characters called “line” with an initial size of zero?
- Write a statement to declare a vector of integers called “Ages” with an initial size of 20 and each element has a value of 20?
-Declare a vector of characters called “sentences” with a size of 60?
-Declare a vector of “sentence” (declared above) called “page” with a size of 50?
-Declare a vector of “pages” (declared above) called “Book” with a size of 0?
Explanation / Answer
a) char line[0]; b)int Ages[20]={20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20}; c)char sentences[60]; d)char pages[50][50]; e)char Book[0][50][50]; another way using stl vector library a) vector line[0]; b)vector Ages[20]={20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20}; c)vector sentences[60]; d)vector pages[50][50]; e)vector Book[0][50][50];Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.