do untill new line entered

This is a discussion on do untill new line entered within the C++ Programming forums, part of the General Programming Boards category; Im writing a program where i want it to keep getting input untill a blank line is entered... im using ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    7

    do untill new line entered

    Im writing a program where i want it to keep getting input untill a blank line is entered... im using getline(), im not sure on how to check if a blank line has been entered
    if anyone knows i would greatly apreciate the help. thanks

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Well lets see:
    1) Read Line
    2) If the only character read in is the newline jump to step 4
    3) Else jump to step 1
    4) Jump for joy

  3. #3
    People Love Me
    Join Date
    Jan 2003
    Posts
    412
    Thantos made me giggle with glee.

  4. #4
    Registered User
    Join Date
    Feb 2005
    Posts
    7
    nevermind i figured it out, im new to programing, i decided not to use getline() and my while statement now works with detecting a new line

  5. #5
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by Thantos
    Well lets see:
    1) Read Line
    2) If the only character read in is the newline jump to step 4
    3) Else jump to step 1
    4) Jump for joy
    please don't advocate the use of goto <-- that's a sarcasm smiley
    Last edited by major_small; 02-21-2005 at 12:28 AM. Reason: sarcasm made obvious
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer and Polymorphism help.
    By Skyy in forum C++ Programming
    Replies: 29
    Last Post: 12-18-2008, 08:17 PM
  2. Printing Length of Input and the Limited Input
    By dnguyen1022 in forum C Programming
    Replies: 33
    Last Post: 11-29-2008, 03:13 PM
  3. adding line numbers and concatenating a filename
    By durrty in forum C Programming
    Replies: 25
    Last Post: 06-28-2008, 03:36 AM
  4. Finding carriage returns (\c) in a line
    By JizJizJiz in forum C++ Programming
    Replies: 37
    Last Post: 07-19-2006, 05:44 PM

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