Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. string_to_struct(operators[2]);
  2.  
  3. void string_to_struct(struct operator * operator)
  4. {
  5. char buffer[STRING_SIZE];
  6. char * fullname;
  7. int year;
  8. float tariff;
  9. char * country;
  10. int users;
  11.  
  12. printf("Input your operator :\n");
  13. fgets(buffer, STRING_SIZE, stdin);
  14.  
  15. sscanf(buffer, "%s,%i,%f,%s,%i", operator->fullname, &operator->year, &operator->tariff, operator->info.country, &operator->info.users);
  16.  
  17. /*
  18. printf("%s,%i,%f,%s,%i",fullname, year, tariff, country, users);
  19.  
  20. strcpy(operators[size].fullname, fullname);
  21. operators[size].year = year;
  22. operators[size].tariff = tariff;
  23. strcpy(operators[size].info.country, country);
  24. operators[size].info.users = users;
  25. */
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement