Skip to content

Instantly share code, notes, and snippets.

@dulimarta
Last active January 29, 2016 15:33
Show Gist options
  • Save dulimarta/8a0eadc4412ff2f47284 to your computer and use it in GitHub Desktop.
Save dulimarta/8a0eadc4412ff2f47284 to your computer and use it in GitHub Desktop.
CS452 Lab01 - Sample 4
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 16
int main () {
char *data1;
data1 = malloc (SIZE);
printf ("Please input username: ");
scanf ("%s", data1);
printf ("you entered: %s\n", data1);
free (data1);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment