← Back to Pointers
Question 683
Print a Shelf Label Taken by Const Reference
Print a Shelf Label Taken by Const Reference
Fill in voidprintLabel(const string &text). main is already written: it reads one whole line from input with getline and passes it to printLabel. printLabel must print two lines - the label text, then how many characters the label contains (usetext.length()). For the input: Warehouse Bin the program must print exactly the output shown in Expected Output. Do not put quotes around the text.
Expected Output:
Label: Warehouse Bin Length: 13
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Pointers
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.