Writing Objects

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vivekphlp
    New Member
    • Oct 2007
    • 2

    Writing Objects

    Hello guys ..
    Im writing an small project for my brother in c++ using files.. .
    The Datas are stored correctly & retrieved for some time & later some symbols come into & replace the original data .

    Using seekp() & im randomly writing some data , but that data is not correctly written . .
    Im writing objects to & from from File.. .
    When i used reinterpret_cas t .. . its giving me undefined symbol error in my Turbo C .. .
    Plz help. ..
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Too much detail is missing from your question.

    Like the disc file format.

    I assujme all of your records are the same length and all have the same record layout and your new contents that are randomly written do not exceed the field width and that you are dropping the data in the correct spot.

    Plus anytime I see reinterpret_cas t being used by a beginner, I smell trouble. Usually, in C++ if you have to cast you are a) calling a relic C function or b) your C++ design is weak.

    Comment

    • ashwini1680
      New Member
      • Sep 2007
      • 23

      #3
      Originally posted by vivekphlp
      Hello guys ..
      Im writing an small project for my brother in c++ using files.. .
      The Datas are stored correctly & retrieved for some time & later some symbols come into & replace the original data .

      Using seekp() & im randomly writing some data , but that data is not correctly written . .
      Im writing objects to & from from File.. .
      When i used reinterpret_cas t .. . its giving me undefined symbol error in my Turbo C .. .
      Plz help. ..

      I have same problem.Either i am getting strange characters or records are printed twice or only last rec is printed twice.If u get solution pls forward it to me.Thank you.

      Comment

      Working...