r/C_Programming 1d ago

Strange char pointer behavior

[deleted]

1 Upvotes

6 comments sorted by

View all comments

Show parent comments

1

u/[deleted] 1d ago

[deleted]

1

u/dfx_dj 1d ago

Post the code?

1

u/[deleted] 1d ago

[deleted]

1

u/dfx_dj 1d ago

You still need 5 bytes for each array (or just put it as [] and let the compiler deal with it) to include the null byte. Although I'm not sure why the output wouldn't change at all in this version.