Files
c-programmering-tredje-utgavan/kapitel19/leak1.c
2021-10-01 20:24:05 +02:00

15 lines
253 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
char* buffer;
buffer = malloc(sizeof(char)*15);
*buffer = '\0';
strcpy(buffer, "Hejsan svejsan");
printf("%s\n", buffer);
free(buffer);
return 0;
}