Guest User

Untitled

a guest
Nov 14th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <strings.h>
  3. #include <stdlib.h>
  4. #include <time.h>
  5. #include <unistd.h>
  6.  
  7. char * ameba(char * s1, char * s2);
  8.  
  9. int main(void) {
  10. time_t rawtime;
  11. struct tm * timeinfo;
  12.  
  13. time(&rawtime);
  14. timeinfo = localtime(&rawtime);
  15. printf("Current local time and date: %s", asctime (timeinfo));
  16.  
  17. printf("%s\n", ameba("lessqqmorepewpew", "good luck, have fun"));
  18.  
  19. time(&rawtime);
  20. timeinfo = localtime(&rawtime);
  21. printf("Current local time and date: %s", asctime(timeinfo));
  22.  
  23. printf("%s\n", ameba("lessqqmorepewpew", "good game, well played"));
  24. }
  25.  
  26. char * ameba(char * s1, char * s2) {
  27. char *s;
  28. s = (char *) malloc(128);
  29. sleep(1);
  30. snprintf(s, 128, "phrase1: %s, phrase2: %s", s1, s2);
  31. return s;
  32. }
Add Comment
Please, Sign In to add comment