Thread: file

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    40

    file

    I'm trying to append a txt file which I created by using C program.
    I manually wrote some information into that txt file and now it has 5 filled up information. This file can hold up to 20 information. Which tells us that we only can store 15 more information.
    I've tried using a+ and checked for NULL condition in my file. However, none of these worked. I'm sure 6 to 20 elements are NULL, because the file only has 5 information so far.
    Could anyone help me with appending a txt file?

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Sure Toshiro.

    Post up your code so we can see where the problem is. My "remote viewing" supersensors, are in the repair shop.

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    1,066
    Quote Originally Posted by tosihiro2007 View Post
    I manually wrote some information into that txt file and now it has 5 filled up information. This file can hold up to 20 information. Which tells us that we only can store 15 more information.
    Why do you think that the file can only take "20 information" (assuming you mean objects/records/elements/...)?

    Anyways, show your code.

    Bye, Andreas

  4. #4
    Registered User
    Join Date
    Feb 2013
    Posts
    40
    I think I fixed it by myself....

  5. #5
    Stoned Witch Barney McGrew's Avatar
    Join Date
    Oct 2012
    Location
    astaylea
    Posts
    420
    I manually wrote some information into that txt file and now it has 5 filled up information. This file can hold up to 20 information. Which tells us that we only can store 15 more information.
    Unless your hard disk is filled up, don't you think it should be able to store more than that?

    I've tried using a+ and checked for NULL condition in my file. However, none of these worked.
    So, did fopen return a null pointer or not?

    I'm sure 6 to 20 elements are NULL, because the file only has 5 information so far.
    What does this mean?

    Even though it won't 'fix' your program, "a+" opens the file, in append mode, for writing *and* reading (update). Since you're only writing to it, you want "a".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 12-06-2012, 02:46 PM
  2. Replies: 3
    Last Post: 11-28-2012, 09:16 AM
  3. Replies: 12
    Last Post: 06-18-2012, 08:23 AM
  4. Replies: 11
    Last Post: 09-25-2011, 12:22 AM
  5. Replies: 4
    Last Post: 07-06-2006, 02:53 AM