Putting text after inputting a variable

This is a discussion on Putting text after inputting a variable within the C++ Programming forums, part of the General Programming Boards category; How would I have text after a variable is entered so for example: I need to put a comma after ...

  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    16

    Putting text after inputting a variable

    How would I have text after a variable is entered so for example: I need to put a comma after the first number.. so it'd say 5, 5 instead of 55.

    Code:
    cout << "The slope of every horizontal line is " << slope(Need a comma here) << slope2 << '\n';

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,799
    This what you are asking?

    Code:
    cout << "The slope of every horizontal line is " << slope << ", " << slope2 << '\n';
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    16
    Yes, thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another n00b question: storing text as a variable
    By Jmcrofts in forum C++ Programming
    Replies: 1
    Last Post: 07-29-2007, 08:12 AM
  2. Collecting text and putting in string
    By FlyingIsFun1217 in forum C++ Programming
    Replies: 14
    Last Post: 04-08-2007, 11:46 AM
  3. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 03:49 PM
  4. Putting text into an edit box
    By eam in forum Windows Programming
    Replies: 5
    Last Post: 11-08-2003, 01:22 AM
  5. Inputting text in OpenGL environment
    By Crossbow in forum Game Programming
    Replies: 7
    Last Post: 05-02-2002, 09:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21