strdup c
snippet in c

strdup c

user6193

// use : char *strdup(char *str)

string1 = "hello"
string2 = strdup(string1)"

printf("%s", string2)

// print : hello