clear string
This commit is contained in:
10
~/C/clear_string.c
Normal file
10
~/C/clear_string.c
Normal file
@ -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;
|
||||
}
|
Reference in New Issue
Block a user