Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <libzoneinfo.h>
  2. #include <locale.h>
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7. char *cur_country = NULL;
  8. int nctnt, i;
  9. struct tz_continent *ctnts = NULL;
  10. struct tz_continent *pctnt = NULL;
  11. char *cntry_name;
  12. int nctry;
  13. struct tz_country *cntries;
  14. struct tz_country *pctry;
  15.  
  16.  
  17.  
  18. setlocale(LC_MESSAGES, "");
  19. nctnt = get_tz_continents(&ctnts);
  20.  
  21. if (nctnt == -1) {
  22. printf("No continent data\n");
  23. }
  24.  
  25.  
  26. for (i = 1, pctnt = ctnts; pctnt != NULL;
  27. pctnt = pctnt->ctnt_next, i++) {
  28.  
  29. printf("%s\n", pctnt->ctnt_name);
  30. if(strcmp(pctnt->ctnt_name, "Europe")==0){
  31. nctry = get_tz_countries(&cntries, pctnt);
  32. if (nctry == -1) {
  33. printf("No countries in Europe\n");
  34. }
  35.  
  36. }
  37. /* if (strcmp(cur_country, cntry_name) != 0) {
  38. continue;
  39. }*/
  40.  
  41. }
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement