omitting an empty line

This is a discussion on omitting an empty line within the C Programming forums, part of the General Programming Boards category; say I have a file: Code: _____________(empty line here) empty : how do I empty the first empty line and ...

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    569

    omitting an empty line

    say I have a file:

    Code:
    _____________(empty line here)
    empty :
    how do I empty the first empty line and go to the next line? I tried to do strcmp(line, "\n") == 0, but it doesn't work.. where line is the first line read?

    what should I do?

  2. #2
    Registered User dinjas's Avatar
    Join Date
    Feb 2005
    Location
    Vancouver, Washington
    Posts
    40
    try using isspace() to skip over whitespace
    straight off the heap

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    151
    Did you try strcmp(line,'\0') ?
    The first thing I try would be what u tried , but if it did not work maybe it could work. The func he mentioned works .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading a buffer line by line, while using system read
    By Hammad Saleem in forum C Programming
    Replies: 9
    Last Post: 05-27-2008, 06:41 AM
  2. line number on a rich edit control
    By rakan in forum Windows Programming
    Replies: 1
    Last Post: 02-18-2008, 07:58 AM
  3. Adding Line numbers in Word
    By Mister C in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 06-24-2004, 09:45 PM
  4. Trouble replacing line of file
    By Rpog in forum C Programming
    Replies: 4
    Last Post: 04-19-2004, 11:22 AM

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