can't save 13th record in files

This is a discussion on can't save 13th record in files within the C Programming forums, part of the General Programming Boards category; please help me bcoz, u see i used 'typedef struct' to store an array about 100 record..and you see the ...

  1. #1
    Unregistered
    Guest

    Angry can't save 13th record in files

    please help me bcoz, u see i used 'typedef struct' to store an array about 100 record..and you see the problem is when i store it into .dat file it only allow me to store record that are not the 13th..in other words, i can store file up to any size but when i store the 13th record in the files it will delete all the content in the file but there is nothing wrong if i straight away store up to 14th files or more until the 26th record ..and 39th record..a bit weird..and i check it many many times the codes is probably nothing wrong (based from what i've learned). I hope some of u guyz will help me ....for more information i use fwrite and the the fopen with 'w'.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    My psychic abiltiy enables me to see your problem! Unfortunately I'm just way to tired to type up the lengthy description of the problem tonight.

    Perhaps if you post some code, some of the other, less tired, people will help you out...

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    /me sees a whole lot of text and not a whole lot of code.

    I would suggest commenting out the line that looks like this
    Code:
    if(record != 13)
       fwrite(record, sizeof(record), 1, fp);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Save files move when folder moves
    By mill1k in forum C++ Programming
    Replies: 5
    Last Post: 04-03-2004, 03:35 PM
  2. how to write and save ini files like some apps do with their ini's
    By Mouse_103 in forum Windows Programming
    Replies: 1
    Last Post: 12-19-2003, 11:05 AM
  3. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 08:12 PM
  4. updating and deleting a record
    By Burritt in forum C Programming
    Replies: 2
    Last Post: 04-19-2003, 04:58 PM
  5. String sorthing, file opening and saving.
    By j0hnb in forum C Programming
    Replies: 9
    Last Post: 01-23-2003, 12:18 AM

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