Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/22/02 20:27
Read: times


 
#23280 - RE: circular buffers by pointers or index ?
what i need to do is a circular buffer double the size of my message which is 18 bytes long.
the newly comming bytes beeing written with the head pointer while the read bytes increment the tail pointer. If the head pointer catches the tail pointer i need to increment the tail pointer to actually overwrite the tail pointer with no error message.
It looks messy when the the head pointer is at the begining of the buffer and the tail at the end. is there a good way of doing it in C or do i have to include lots of ifs and buts statements ?
i would have thought its very easy implementing this with pointers rather than indexex.
My boss is a programmer and he has allergy to assembly so he wants me to write the code in c for portability and for him to understand it!

List of 25 messages in thread
TopicAuthorDate
circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or inde            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or inde            01/01/70 00:00      
RE: circular buffers by pointers or inde            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: Steve            01/01/70 00:00      
RE: Peter            01/01/70 00:00      
Ring buffered serial IO            01/01/70 00:00      
RE: pointers vs. indexes            01/01/70 00:00      
RE: Ring buffered serial IO            01/01/70 00:00      
RE: pointers vs. indexes            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or inde            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      
RE: circular buffers by pointers or index ?            01/01/70 00:00      

Back to Subject List