Message from C, C++ talks

July 2019

— No, you're responsible to check

— No

— This depends on what are u really write

— Void ripspace(char* str){
char* dest = str;
if( *str!=' ') *dest++=*str;

Message permanent page


Assume it's a library, and it's doc says you need to check all NULL's if you don't want sudden segfaults

— Bad solution for library


if (!str) return;

— Where is a problems?

— No, the caller is responsable

— You would encounter problems if you try to write something with that kind of lib :)

— Stdlib from C doesn't check anything

— At most, the called will make assert

— It's... not very modern you know.

— You can code with python

— As i said early, that depends on whar are you really want