Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <strings.h>
- #include <stdlib.h>
- #include <time.h>
- #include <unistd.h>
- char * ameba(char * s1, char * s2);
- int main(void) {
- time_t rawtime;
- struct tm * timeinfo;
- time(&rawtime);
- timeinfo = localtime(&rawtime);
- printf("Current local time and date: %s", asctime (timeinfo));
- printf("%s\n", ameba("lessqqmorepewpew", "good luck, have fun"));
- time(&rawtime);
- timeinfo = localtime(&rawtime);
- printf("Current local time and date: %s", asctime(timeinfo));
- printf("%s\n", ameba("lessqqmorepewpew", "good game, well played"));
- }
- char * ameba(char * s1, char * s2) {
- char *s;
- s = (char *) malloc(128);
- sleep(1);
- snprintf(s, 128, "phrase1: %s, phrase2: %s", s1, s2);
- return s;
- }
Add Comment
Please, Sign In to add comment