Created
July 30, 2013 13:00
-
-
Save dafyddcrosby/6112685 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
void main() { | |
char *str; | |
str = malloc(sizeof(char) * 15); | |
strcpy(str, "hakuna matata!"); // this line should copy "hakuna matata!" | |
// into our char array | |
printf("%s\n", str); | |
free(str); | |
// Anything else? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment