Thread: Breaks

  1. #1
    wuzzuppy_123
    Guest

    Breaks

    Hi
    I'm new to C++ and I don't know how to make breaks between cout<< messages
    can anyone help me?

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    endl or \n for newlines.

    i.e.

    cout << "message" << endl;

    or

    cout << "message" << '\n';

    also, check the faq.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    118
    you mean like breaking out of a loop with couts???

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    162
    What exactly do you mean by breaks? If you mean line breaks, its easy; just do:
    cout << message << "\n" << message2;

    this would display like:
    message
    message2

    Its that simple.

    If you're new, you should probably check out some of the tutorials on sites like gamedev.net and cprogramming.com (this bb's host site). Those will help you a lot.

  5. #5
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    this would display like:
    message
    message2
    um no actually it wouldnt, to show that you need quotes : )

  6. #6
    Registered User
    Join Date
    Jan 2003
    Posts
    88
    well if message and message2 are char*'s which contain "message" and "message2" respectively then it would.

  7. #7
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Also, you could do this:
    Code:
    cout << "message1\nmessage2";
    This would output:

    message1
    message2
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. my code breaks unique pointer rule?
    By George2 in forum C++ Programming
    Replies: 19
    Last Post: 02-17-2008, 03:26 AM
  2. extra line breaks from recv?
    By xconspirisist in forum C++ Programming
    Replies: 3
    Last Post: 07-07-2005, 01:00 AM
  3. sentence word breaks...
    By aker_y3k in forum C++ Programming
    Replies: 4
    Last Post: 10-13-2003, 11:52 AM
  4. switches and breaks
    By volk in forum C Programming
    Replies: 11
    Last Post: 01-10-2003, 08:55 PM
  5. Refreshing breaks page
    By Imperito in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 04-19-2002, 11:54 AM