end of line.

This is a discussion on end of line. within the C++ Programming forums, part of the General Programming Boards category; hi, how can i count the number of a text through a C++ program? this does not work. isn't there ...

  1. #1
    Unregistered
    Guest

    end of line.

    hi, how can i count the number of a text through a C++ program?
    this does not work.

    isn't there a command like file_name.eof();?
    but for the end of every line? like eol()?? (end of line)

    thanks.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Test for a newline character '\n'.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Well first yoy should open a file in read mode. Then increment a counter till it reached EOF i.e end of file. SO this way you have it. If you want to count the number of wards then find the blank spaces by incrementing the counter when ever " " is got before the EOF this way you get the number of words

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, 08: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, 01:19 AM
  3. SSCANF help
    By mattz in forum C Programming
    Replies: 7
    Last Post: 12-10-2001, 03:53 PM
  4. Validating the contents of a char buffer
    By mattz in forum C Programming
    Replies: 3
    Last Post: 12-09-2001, 05:21 PM

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