From be9d9aedb53e9b3211765f16bf4b90f5d31c1722 Mon Sep 17 00:00:00 2001 From: EliteTK Date: Mon, 24 Feb 2014 21:03:53 +0000 Subject: Added all files --- allocing.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 allocing.c (limited to 'allocing.c') diff --git a/allocing.c b/allocing.c new file mode 100644 index 0000000..af19dab --- /dev/null +++ b/allocing.c @@ -0,0 +1,19 @@ +#include +#include + +int main(int argc, char *argv[] ) { + // malloc test + char * string; + string = (char *) malloc(10 * sizeof(char)); + + *(string + 0) = 'a'; + *(string + 1) = 'b'; + *(string + 2) = 'c'; + *(string + 3) = '\n'; + *(string + 4) = '\0'; + + printf("%s", string); + + free(string); + string = NULL; +} -- cgit v1.2.3-54-g00ecf