Write a C++ statement that uses the manipulator \'setfill\' to output a line con
ID: 3545725 • Letter: W
Question
Write a C++ statement that uses the manipulator 'setfill' to output a line containing 35 asterisk characters.
Here is the answer that I was given by a user on here
#include <iomanip>
cout<<setfill("*")<<setw(35)<<" ";
But I think it should be what I have below except my instructor says that I am missing something
#include <iomanip>
cout<<setfill("*")<<setw(35)<<"/n";
Why is it <<" "; and not <<"/n";
My instructor is saying that there is something missing between setw(35)<< and "
Explanation / Answer
is the new line character,
Maybe you can try this:
cout<<setfill('*')<<setw(35)<<'*'<<" ";
Note, setfill cannot use double quotation marks, must use single
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.