snipplets.dev/code/C/Strings/clear_string.c

10 lines
173 B
C
Raw Normal View History

2024-04-27 23:54:46 +03:00
int main(int argc, char const *argv[]) {
char *buffer = malloc(256 + 1);
buffer[0] = '\0';
strcpy(buffer, "");
memset(buffer, '\0', sizeof(buffer));
return 0;
}