Advertisement
Guest User

Untitled

a guest
Jun 7th, 2017
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. void add_table(struct Table* t, const char* _code, const char* _name, const int _numb)
  2. {
  3.     for (int i = 0; i < current_num_tables; ++i)
  4.     {
  5.         if (!strcmp(_code, t[i].code)) {
  6.             t[i].numb += _numb;
  7.             return;
  8.         }
  9.     }
  10.  
  11.     strcpy(t[current_num_tables].code, _code);
  12.     strcpy(t[current_num_tables].name, _name);
  13.     t[current_num_tables].numb = _numb;
  14.     current_num_tables++;
  15.     return;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement