Advertisement
Guest User

Untitled

a guest
May 16th, 2023
129
0
2 hours
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <unistd.h>
  3. #include <string.h>
  4. #include <stdio.h>
  5. #include <sys/types.h>
  6.  
  7. struct internet {
  8. int priority;
  9. char *name;
  10. };
  11.  
  12. void winner()
  13. {
  14. printf("and we have a winner @ %d\n", time(NULL));
  15. }
  16.  
  17. int main(int argc, char **argv)
  18. {
  19. struct internet *i1, *i2, *i3;
  20.  
  21. i1 = malloc(sizeof(struct internet));
  22. i1->priority = 1;
  23. i1->name = malloc(8);
  24.  
  25. i2 = malloc(sizeof(struct internet));
  26. i2->priority = 2;
  27. i2->name = malloc(8);
  28.  
  29. strcpy(i1->name, argv[1]);
  30. strcpy(i2->name, argv[2]);
  31.  
  32. printf("and that's a wrap folks!\n");
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement