clear string
This commit is contained in:
parent
6bf29bf316
commit
5c26c657d5
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user