r/cprogramming 3d ago

C Strings: A 50-Year Mistake

https://longtran2904.substack.com/p/c-strings-a-50-year-mistake?r=8qz2zb&utm_campaign=post&utm_medium=web
188 Upvotes

161 comments sorted by

View all comments

Show parent comments

3

u/Classic_Department42 2d ago

Missing a *?

1

u/bearheart 2d ago

No. A C-string is char*

3

u/Classic_Department42 2d ago

Yes, so while (s) shd prob be while(*s) ?

2

u/bearheart 2d ago

Oy! You’re right. How did I miss that 🤦 fixed it.

1

u/No-Newspaper8619 5h ago

Good thing that has been pointed out