file append

This is a discussion on file append within the C Programming forums, part of the General Programming Boards category; Hi, i got a input text file,its data is as follows: *the number dont exist in the input test file,added ...

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    58

    file append

    Hi,
    i got a input text file,its data is as follows:
    *the number dont exist in the input test file,added for reference only*
    Code:
    1. intial line
    2. second line of file
    3. hope you are having great day
    4.thankin you
    5.Rahul
    6.
    7.
    *line 6,7 is blank*

    Now,I am supposed to append this line "last line of file" to that text file.

    appended line at the end of the file or after the last text line . ?????

    In generally speaking terms,the appended line should be at line 8,or at line 6???Do share.Thanks.

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,793
    I would personally say at the end of the file (line 8) if lines 6 and 7 exist and are either newlines or full of some indeterminate number of spaces. Someone else may have a different preference.
    "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
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,420
    I'd agree with hk_mp5kpdw on this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  3. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 09:57 AM
  4. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

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