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

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by grommet2481
0

If you are using cout then you can use setw()

#include <iostream>
#include <iomanip>
using namespace std;

int main(int argc, char* argv[])
{
    cout << setw(10) << "Hello";
    return 0;
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.