Need some help with serialization & deserialization #4651
-
@nlohmann But I am having issues while picking up the data. the string returned by the json.dump() is following: {"profile":{"data":{"age":21,"graduation":"1956","institute":"X-men","name":"Wolverine"},"expiry":1739613272}} But json::parse() is throwing when i pass the above string. my guess is that since this is not a raw string, the " is ending the string. please help me with this. I am fairly new to all this, so give me as much advice as possible. I am doing this for a job assignment, so quick responses would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
Please provide code. |
Beta Was this translation helpful? Give feedback.
-
My Code:
|
Beta Was this translation helpful? Give feedback.
Hey @nlohmann , Thanks for helping me. I have mostly wrote code in Codeforces or Leetcode, So don't have much idea about developing with c++. The debugger gave me context to solve the problem.
The problem was with ftruncate() which removes the data but have to use the lseek() to move the position where the data should be appended in file.
thanks again, this project really helped me complete this assignment.