Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is how concat() works in the C library, except that in the case where the original string is too long it will overwrite random memory instead of reallocating the original string.


You probably mean strcat() (which should really not be used, since now there is strncat()), there is no concat() in standard C library. strcat() does not intercept syntax of operation that does not mutate its arguments in any other context (+), you also cannot do strcat("hello,", " world") since the first argument must be mutable.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: