aboutsummaryrefslogtreecommitdiff
path: root/semestr-4/ask/lista8/str-b.c
diff options
context:
space:
mode:
Diffstat (limited to 'semestr-4/ask/lista8/str-b.c')
-rw-r--r--semestr-4/ask/lista8/str-b.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/semestr-4/ask/lista8/str-b.c b/semestr-4/ask/lista8/str-b.c
new file mode 100644
index 0000000..50101cb
--- /dev/null
+++ b/semestr-4/ask/lista8/str-b.c
@@ -0,0 +1,9 @@
+#include <stdlib.h>
+#include <string.h>
+
+char *somestr(void) {
+ char *buf = malloc(sizeof("Hello, world!"));
+ strcpy(buf, "Hello, world!");
+ return buf;
+}
+