title: "this" pointer in C (not C++)
body: <p>I'm trying to create a stack in C for fun, and came up with the idea of using struct to represent the stack. Then I add function pointers to the struct for push() and pop() operations. </p>
  
  <p>So far all is good it seems, but, for the implementation of the push() and pop() functions I need to refer to *this somehow. How can that (can it?) be done?</p>
  
  <p>This is my struct</p>
  
  <pre><code>struct Stack {
      int *data;
      int current_size;
      int max_size;
      int (*push)(int);
      int (*pop)();
  };
  </code></pre>
  
  <p>And as an example here's push</p>
  
  <pre><code>int push(int val) {
      if(current_size == max_size -1)
              return 0;
  
      data[current_size] = val;
      current_size++;
  
      return 1;
  }
  </code></pre>
  
  <p>As you can imagine, the compiler has no idea what <code>current_size</code> is, as it would expect something like <code>stack-&gt;current_size</code>. </p>
  
  <p>Is this possible to overcome somehow?</p>