• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

C: Problem with removing specific record from a text file

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having a problem when trying to delete specific record from a text file.
Data structure is as follows (binary search tree):



Functions for searching, traversion and removing node:



Part of main() for removing BST node from file:



The code is too long to post entirely, so could someone just point out what is wrong (I thing something in main() is not right)?

Thanks for replies.
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, you should describe details of what problem you're seeing, instead of leaving it hanging with a "I am having a problem...".
Please read this page and follow the instructions there.

I can spot multiple problems around the reading loop and root node, all of which can be easily found with a debugger.
Debugging, code stepping and variable inspectors are an essential skill for C/C++ programming.
Please run your application inside a debugger and tell us what you find.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic