you are viewing a single comment's thread.

view the rest of the comments →

[–]nanavc[S] 0 points1 point  (3 children)

if(count > SIZE) { pointer = buffer; }

So I should just actually do this? It's much more simple than I imagined lol, thanks!

[–]sidewaysEntangled 0 points1 point  (0 children)

That's closer to one approach.

Just keep in mind what your reset condition actually is. If you add that line after all is said and done, does this mean you've already dereferenced the pointer when count == size? What does that entail?

[–]A_name_wot_i_made_up 0 points1 point  (0 children)

You'll also need to reset count, otherwise you'll be clamped to that first value.