CSC443 PL2 - how to distinguish between two attributes of record in buffer?
Author Message
c8luwenk Offline
Student


Reputation: 0
Post: #1
CSC443 PL2 - how to distinguish between two attributes of record in buffer?
Hi,

We have a general question about PL2's Section 2 where we read and write variable length record from and to buffer. For example, we have a record of 100 attributes such that record(attr1, attr2, ... attr100). Now here is our questions,

1. When we write to buffer, how can we distinguish between two attributes? For example, in the buffer, it will be "attr1attr2attr3...attr100", as you can see, we have all the data of attributes stacked up, but when we do a read, how can we tell each attribute's starting point? We are thinking that we should be a null character ("\0") or a comma (,) that separate the attributes. Are we correct?

2. This is for confirmation. When we write a data to buffer, we are all using const char. Are we correct? For example, if we have an integer, we have to convert it to const char and write it to buffer. Right?

Thank you very much for the help!
2013-02-10 21:39
Find all posts by this user Quote this message in a reply
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5


Forum Jump:


User(s) browsing this thread: 1 Guest(s)