Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #define STR "my string"
  2. #define STR2 "my string 2"
  3.  
  4.  
  5. #define MACRO(x) do_something(x)
  6.  
  7. int get_new_hash_map_id() {
  8.     static int my_counter = 0;
  9.     return ++my_counter;
  10. }
  11.  
  12.  
  13. void do_something(const char* s) {
  14.     int id;
  15.     if(is_not_in_id_hash_map(s)) {
  16.         id = get_new_hash_map_id();
  17.     } else {
  18.         id = get_id_hash_map(s);
  19.     }
  20.     some_function(s, id
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement