Hacker News new | past | comments | ask | show | jobs | submit login

Only in C, even C++ has since the early days adopted proper strings on its standard library, initially the compiler specific ones from the early 90's, then the standard one.



Sure, its just that these kind of strings were historically called Pascal-strings [0] because they were the way Pascal implemented strings.

[0] And still are! For example, Python refers to them as such, see the "p" (lowercase p) character code here: https://docs.python.org/3/library/struct.html#format-strings


Not all C++ string libraries use Pascal strings.

Some of them use a fat pointer instead, with a mix of counter, pointer to the end, and null terminator for C compatibility.


That's ingenious, but I don't think I've heard a name for those kind of strings.


One thing is certain, they aren't Pascal strings.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: