diff --git a/~/C/clear_string.c b/~/C/clear_string.c new file mode 100644 index 0000000..4ab0bab --- /dev/null +++ b/~/C/clear_string.c @@ -0,0 +1,10 @@ +int main(int argc, char const *argv[]) +{ + char *buffer = malloc(256 + 1); + + buffer[0] = '\0'; + strcpy(buffer, ""); + memset(buffer, '\0', sizeof(buffer)); + + return 0; +}