86. Circular Buffer Read

Discussions1
Log in to post comments and replies.
You
Loading editor...
SSARVESH
SSARVESH
Feb 15 2026

while(n--)

    {

        if(cb->count-- > 0)

        printf("%d ",cb->buffer[(cb->tail++)%10]);

        else 

        printf("NULL ");

    }

    printf("\nTail: %d",(cb->tail)%10);

 

all test cases re matching but showing error.

 

+2
NabilMohamed
NabilMohamed
Jun 24 2026

Hello!

I faced a similar issue, and felt perplexed because my output and the expected output looked exactly alike. So I understand that this can feel frustrating.

Here is a clue - pay special attention to how you print each character.

I hope that helps! (if not, please let me know! I am more than happy to elaborate)

0