unable to allocate memory in middle of file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • svsteja1991
    New Member
    • Jan 2013
    • 1

    unable to allocate memory in middle of file

    I created a structure containing two variables of type char.

    i.e.
    Code:
    char name[64],char details[128];
    And a pointer to structure now when I write this name and details to file and now I want to change the particular name.

    i.e.

    To modify then if the stored file name is greater than the entered name then it is erasing the next record line also I need to allocate some memory.
    Last edited by Frinavale; Jan 24 '13, 02:32 PM. Reason: Added code tags and fixed capitalization of "I" and capitalization of the first letter of the first word in a new sentence.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    If we are going to help you discern the problem it would be helpful to see the code you already have that writes to and reads from the file.

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      Also, the answer is different if you are using C++ instead of C.

      Comment

      Working...