I wonder, why such function as:
-memset
-memmov
-memchr
-memcpy
Exist in string.h header file, but not in stdlib.h file, where there are ot
Besides historical considerations, the separation of data manipulation utilities like those in string.h
and system functions like malloc
in stdlib.h
makes a lot of sense when you consider contexts where an operating system is not a given. Embedded systems may or may not have an RTOS and they may or may not have standard memory allocation available. However, utilities like strcpy
and memcpy
occupy a similar space in that they do not rely on any external systems and therefore can be run in any context where you can run compiled code. Conceptually and practically it makes sense to put them together, and to separate them from more complex system calls.