Thread: simple question

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    20

    simple question

    is it possible to have two parts of text on the one line?

    eg:
    Code:
     cout<<"hello" <<start "hi again" << endl;
    i know the above way is not possible but does anyone know a way of doing this??

  2. #2
    .........
    Join Date
    Nov 2002
    Posts
    303
    Try this.
    Code:
    cout<< "hello" << start << "hi again" << endl;

  3. #3
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    Originally posted by SourceCode
    Try this.
    Code:
    cout<< "hello" << start << "hi again" << endl;
    Note: start should be a variable name.
    Because if it's somehting else, it might not work!
    also the output is always in the same line until you want to have a newline.
    Example:
    cout << "hi";
    cout << ", how are you.";
    will output:
    hi, how are you.
    Does this answers your question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple question regarding variables
    By Flakster in forum C++ Programming
    Replies: 10
    Last Post: 05-18-2005, 08:10 PM
  2. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-20-2005, 11:41 PM
  3. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 09:46 AM
  4. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 12:15 PM
  5. simple fgets question
    By theweirdo in forum C Programming
    Replies: 7
    Last Post: 01-27-2002, 06:58 PM