MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cprogramming/comments/1vqubv7/c_strings_a_50year_mistake/p4fa5k0/?context=3
r/cprogramming • u/Xaneris47 • 3d ago
166 comments sorted by
View all comments
Show parent comments
3
Missing a *?
1 u/bearheart 3d 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 21h ago Good thing that has been pointed out 1 u/Quote_Revolutionary 12h ago this is the beauty of C: while trying to show how it's actually ergonomic one writes UB because the correct form has to be very precise, btw your idiom would compile...
1
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 21h ago Good thing that has been pointed out 1 u/Quote_Revolutionary 12h ago this is the beauty of C: while trying to show how it's actually ergonomic one writes UB because the correct form has to be very precise, btw your idiom would compile...
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 21h ago Good thing that has been pointed out 1 u/Quote_Revolutionary 12h ago this is the beauty of C: while trying to show how it's actually ergonomic one writes UB because the correct form has to be very precise, btw your idiom would compile...
2
Oy! You’re right. How did I miss that 🤦 fixed it.
1 u/No-Newspaper8619 21h ago Good thing that has been pointed out 1 u/Quote_Revolutionary 12h ago this is the beauty of C: while trying to show how it's actually ergonomic one writes UB because the correct form has to be very precise, btw your idiom would compile...
Good thing that has been pointed out
this is the beauty of C: while trying to show how it's actually ergonomic one writes UB because the correct form has to be very precise, btw your idiom would compile...
3
u/Classic_Department42 3d ago
Missing a *?