Initial commit
This commit is contained in:
17
kapitel19/undersoka-minne.c
Normal file
17
kapitel19/undersoka-minne.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char *a;
|
||||
a = malloc(10*sizeof(char));
|
||||
*a = '\0';
|
||||
strcpy(a, "Hej hej");
|
||||
printf("Strängen %s\n", a);
|
||||
*a = '\0';
|
||||
printf("Strängen %s\n", a);
|
||||
|
||||
free(a);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user