end of line...

This is a discussion on end of line... within the C++ Programming forums, part of the General Programming Boards category; Hello, friends... I am attempting to write a program that read characters from a file until the end of a ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    Unhappy end of line...

    Hello, friends...
    I am attempting to write a program that read characters from a file until the end of a line. However, my while loop refuses to stop. Does anyone know how I can test a single character to see if it is at the end of the line. In case it matters, I'm using Borland C++ 5.0

  2. #2
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    if (c == '\n') ...

    or if this is C++ Builder & you're using AnsiString

    if (astr[n] == '\n')

    also in Windows, text files are usually end with line feed ('\n') and carriage return pairs ('\r').

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    Smile thanks

    Thank you much

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Could somebody please help me with this C program
    By brett73 in forum C Programming
    Replies: 6
    Last Post: 11-25-2004, 02:19 AM
  3. end of line.
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2002, 05:01 AM
  4. SSCANF help
    By mattz in forum C Programming
    Replies: 7
    Last Post: 12-10-2001, 04:53 PM
  5. Validating the contents of a char buffer
    By mattz in forum C Programming
    Replies: 3
    Last Post: 12-09-2001, 06:21 PM

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