44. Peek N Bytes from Circular Buffer

You are given a pre-filled circular buffer of fixed size 10.

Your task is to implement a function that peeks at the next n bytes starting from the current read position (tail), without removing them or modifying the buffer state.

If n is greater than the number of available bytes (count), print "NULL" for each extra byte.

Only use pointer access (-> or (*cb).field), no dot (.) operator.

 

Example-1

Input: n = 4
Output: 80 90 100 10

Example-2

Input: n = 6
Output: 80 90 100 10 20 30

Example-3

Input: n = 8
Output: 80 90 100 10 20 30 NULL NULL


 

Loading...

Input

4

Expected Output

80 90 100 10