4 ms·
> a barely functional string type There's a string type in C? All I see are character arrays and a few (poorly thought out) conventions for using them.
by mschaef 14y ago
> a barely functional string type
There's a string type in C? All I see are character arrays and a few (poorly thought out) conventions for using them.
- dionidium 14y agohttp://en.wikipedia.org/wiki/Null-terminated_string http://en.wikipedia.org/wiki/Null-terminated_string
- pjmlp 14y agoForget to place that NULL in the right place and boom!
- runarb 14y agoIt may be cumbersome, but C has string handling: http://en.wikipedia.org/wiki/C_string_handling http://en.wikipedia.org/wiki/C_string_handling
- deelowe 14y agoThis is an article about the standard library. C has no built in string handling. As an example, there are embedded systems that do no have support for string types due to a lack of support for libraries that handle it, yet they are 100% compliant with the C spec.
- tedunangst 14y agoHow you can be 100% compliant with the C spec by omitting strlen is a mystery to me.
- caf 14y agoThe C standard library is specified as part of the language specification document. The language defines two kinds of implementations: "hosted", which must support the entire standard library; and "freestanding", which do not. Those embedded systems that do not support the full standard library are 100% compliant freestanding implementations, but are not compliant hosted implementations.