Initial commit
This commit is contained in:
20
kapitel9/calloc-ex1.c
Normal file
20
kapitel9/calloc-ex1.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char *a, *b;
|
||||
a = calloc(30, sizeof(char));
|
||||
|
||||
strcat(a, "hej hej");
|
||||
printf("%s\n", a);
|
||||
free(a);
|
||||
|
||||
b = calloc(30, sizeof(char));
|
||||
strcat(b, "hej igen");
|
||||
printf("%s\n", b);
|
||||
free(b);
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user