Last active
January 19, 2023 03:37
-
-
Save dulimarta/a4d0dabaf7d0232fb212 to your computer and use it in GitHub Desktop.
CS452 Lab01 - Sample 2
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define SIZE 16 | |
int main() | |
{ | |
char *data1, *data2; | |
int k; | |
do { | |
data1 = malloc(SIZE); | |
printf ("Please input your EOS username: "); | |
scanf ("%s", data1); | |
if (! strcmp (data1, "quit")) | |
break; | |
data2 = malloc(SIZE); | |
for (k = 0; k < SIZE; k++) | |
data2[k] = data1[k]; | |
free (data1); | |
printf ("data2 :%s:\n", data2); | |
} while(1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment