Thread: Making Spaces in Output

  1. #1
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719

    Smile Making Spaces in Output

    Hellooooooo, I have a question about making spaces between the output of a program. Here is an example of what I mean.

    Instead of the output being like this:

    Code:
    WELCOME
    HOW ARE YOU DOING?
    I want it to be like this:

    Code:
    WELCOME 
    
    HOW ARE YOU DOING?
    So what I want to know is how to make a space like that.
    Thanks. This isn't urgent or anything, just wanted to make the output of the program easier to read.
    Videogame Memories!
    A site dedicated to keeping videogame memories alive!

    http://www.videogamememories.com/
    Share your experiences with us now!

    "We will game forever!"

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    You can send a new-line character. You could also use endl - this'll flush output too.

    Code:
    cout << "WELCOME\n\nHOW ARE YOU DOING?";
    cout << "WELCOME" << endl << endl << "HOW ARE YOU DOING?";

  3. #3
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    Quote Originally Posted by Sentral
    Hellooooooo, I have a question about making spaces between the output of a program. Here is an example of what I mean.

    Instead of the output being like this:

    Code:
    WELCOME
    HOW ARE YOU DOING?
    I want it to be like this:

    Code:
    WELCOME 
    
    HOW ARE YOU DOING?
    So what I want to know is how to make a space like that.
    Thanks. This isn't urgent or anything, just wanted to make the output of the program easier to read.
    logic is simple:
    first line: put message
    second line: put a newline '\n'
    third line: put message
    Warning: Opinions subject to change without notice

    The C Library Reference Guide
    Understand the fundamentals
    Then have some more fun

  4. #4
    For Narnia! Sentral's Avatar
    Join Date
    May 2005
    Location
    Narnia
    Posts
    719
    OKKKKKKK. I understand it now. Now the program output looks reasonable, instead of some ridiculous pile of words. HAHA. Thanks.
    Videogame Memories!
    A site dedicated to keeping videogame memories alive!

    http://www.videogamememories.com/
    Share your experiences with us now!

    "We will game forever!"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Having trouble making a function do what I want.
    By Shamino in forum C++ Programming
    Replies: 9
    Last Post: 12-07-2007, 11:20 AM
  2. Output an array in a textbox
    By Diablo02 in forum C# Programming
    Replies: 5
    Last Post: 10-18-2007, 03:56 AM
  3. Connecting input iterator to output iterator
    By QuestionC in forum C++ Programming
    Replies: 2
    Last Post: 04-10-2007, 02:18 AM
  4. readable/savable output & making large searchable databases :)
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 04-13-2002, 06:52 PM
  5. Simple File Creation Algorithm
    By muffin in forum C Programming
    Replies: 13
    Last Post: 08-24-2001, 03:28 PM