Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data update/retrieve format

 
Surya Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using a string buffer for updation. For a field 'a' with length 10 and content 'TEST'i 'll be storing TEST\x0000\x0000\x0000\x0000\x0000\x0000. But when retreiving i am taking TEST\x0000\x0000\x0000\x0000\x0000\x0000 but trimming the data and using it. Is it ok or not ok as per the null termination of strings is concerned.
 
Anton Golovin
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Surya Kumar:
i am using a string buffer for updation. For a field 'a' with length 10 and content 'TEST'i 'll be storing TEST\x0000\x0000\x0000\x0000\x0000\x0000. But when retreiving i am taking TEST\x0000\x0000\x0000\x0000\x0000\x0000 but trimming the data and using it. Is it ok or not ok as per the null termination of strings is concerned.


IMHO, if your provided data file does not have null termination, it is not necessary. The requirements say of a different application that also accesses this data file. Since it was provided to you without null termination, it is safe to assume that is how that other application uses it. But of course it is a good candidate to be described in choices.txt.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic