Diferencia entre cuerda.h y cuerdas.h
Noté que había (al menos en Mac OS X) un encabezado string.h
y un encabezado strings.h
. man 3 string
revela que contienen diferentes funciones. ¿Hay alguna razón para esto?
79
2 answers
Cadenas.h proviene de la rama BSD en la evolución de unix. Su contenido ha sido estandarizado por POSIX, pero la mayor parte está marcado como legacy y se puede reemplazar fácilmente con otras funciones:
int bcmp(const void *, const void *, size_t); /* LEGACY, see memcmp */
void bcopy(const void *, void *, size_t); /* LEGACY, see memcpy, memmove */
void bzero(void *, size_t); /* LEGACY, see memset */
int ffs(int);
char *index(const char *, int); /* LEGACY, see strchr */
char *rindex(const char *, int); /* LEGACY, see strrchr */
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
97
Author: AProgrammer,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-11-27 11:10:23
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-11-27 11:10:23
Normalmente <strings.h>
solo agrega algunas funciones de cadena adicionales útiles pero no estándar al encabezado estándar <string.h>
. Para una portabilidad máxima solo debes usar <string.h>
pero si necesitas las funciones en <strings.h>
más de lo que necesitas portabilidad, entonces puedes usar <strings.h>
en lugar de <string.h>
.
14
Author: Paul R,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-11-27 10:28:31
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-11-27 10:28:31