| | |
create blank charaters (white spaces)
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: May 2008
Posts: 6
Reputation:
Solved Threads: 0
I know that this is a simple one but never the less I forget how to do it.
How do I create white spaces on my screen.
Im writting in DEV-C++. I want my output to look something like this
Name title pay
Sam Uni student shit
I know how to output everything on the page but just don't know how to space them out. I know that I could do it by doing a cout statment followed by inverted comma and a shit load of spaces (or as required) inverted comma, semicolon. But that will look messy.
Im just chasing the simple code on how to create those spaces, my friend taught me and my text book sucks and it doesn't teach me.
Cheers
SAM
How do I create white spaces on my screen.
Im writting in DEV-C++. I want my output to look something like this
Name title pay
Sam Uni student shit
I know how to output everything on the page but just don't know how to space them out. I know that I could do it by doing a cout statment followed by inverted comma and a shit load of spaces (or as required) inverted comma, semicolon. But that will look messy.
Im just chasing the simple code on how to create those spaces, my friend taught me and my text book sucks and it doesn't teach me.
Cheers
SAM
If you are using cout then you can use setw()
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <iomanip> using namespace std; int main(int argc, char* argv[]) { cout << setw(10) << "Hello"; return 0; }
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Other Threads in the C++ Forum
- Previous Thread: Want to creat a ascending order sortin character array
- Next Thread: Iterator assertion failure. How?
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets






