#include #include #include char* creerCopieChaineDeCaracteres(char* s) { char* dst = (char*) calloc(strlen(s) + 1, sizeof(char)); if (dst != NULL) { strcpy(dst, s); } return dst; } void main(void) { char* s = "abcdefgh"; char* ns = creerCopieChaineDeCaracteres(s); if (ns != NULL) { printf("Chaine a copier : %s\n", s); printf("Chaine copiee : %s\n", ns); } if (ns != NULL) { free(ns); ns = NULL; } }