1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

A weird bug I cannot seem to catch..

Discussion in 'C' started by cooh, May 29, 2012.

  1. cooh

    cooh New Member

    May 29, 2012
    Likes Received:
    Trophy Points:
    pastebin . com / esxAR3wY
    This is my source code here...It is simply too big and ugly to fit in here, so I used this site..
    If anyone can paste the code into his compiler and help me I will be grateful.
    Everything works except for the "addEntry" function (and I am guessing "resizeArrayCopy" function too)..so if you are willing to help me, look there.
    My problem basically is:
    When I set the buffer size to 4, then load a file that has 4 entries, then I try to add a new entry from the menu, entry number FIVE just shows up blank after that. Entries after this entry are perfectly fine tho.
    When I load a file that has less than 4 elements, then fill up the buffer with my data, the FIFTH element shows some strange characters, and (I think, not 100% sure) that in this case, entries six and onward work perfectly. I have been trying to catch the problem this entire day, and couldn't. If you are willing to help me, you definately need to compile the code and run the program in order to see for yourselves what exactly is wrong, since the code is very ugly written and it is (quite) big..
    PS: compiling with codeblocks
  2. xpi0t0s

    xpi0t0s Mentor

    Aug 6, 2004
    Likes Received:
    Trophy Points:
    Senior Support Engineer
    Can you do a text-mode screen shot (and just paste it in here) to show the input you gave and the output you got? Also state (a) what output was expected, and (b) the implication is that there is a text file that the program relies on, so what is in it?

Share This Page