C++ :: How Is Setfill Used
Oct 9, 2014How is setfill() used? I am trying to use it for a school assignment, but it is not doing anything.
View 1 RepliesHow is setfill() used? I am trying to use it for a school assignment, but it is not doing anything.
View 1 RepliesMy question is simply how do I center the lines on top of one another using setw (without the use of an additional header file or an additional function)?
I've attempted
Code:
setfill(' ')
to no avail as well.
I can manually set the numbers of setw of course, but I was hoping for alternative smarter fix (without having to pain staking manually set & test each setw).
Note for reason I cannot use an additional header file or function: I've always wanted to know if this could even be done without the use of the <strings> header file (and without the use of an accompanying function). That, and I wanted to reduce the amount of lines of code if possible. If there's not an easier way that's fine (just wanted to know if setw or setfill could get the centering job done alone).
I didn't think it could be done (I believe with the header files I have and place & with no additional functional support one would have to simply manually set each setw).
Code:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
char Enter;
[Code] ....