C++ :: How Is Setfill Used

Oct 9, 2014

How is setfill() used? I am trying to use it for a school assignment, but it is not doing anything.

View 1 Replies


ADVERTISEMENT

C++ :: Centering Text With SetW Or SetFill Without Using String Or Function?

Jan 30, 2012

My 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] ....

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved