title: How does the stack_overflow() function work?
body: <p>So I just came to the part in my book where stacks are explained. Here's how they get defined in my book (code):</p>
  
  <pre><code>#include &lt;stdbool.h&gt;
  
  #define STACK_SIZE 100
  
  int contents[STAC_SIZE]
  int top = 0;
  
  void make_empty(void){
      top = 0;
  }
  
  bool is_empty(void){
      return top == 0;
  }
  
  bool is_full(void){
      return top == STACK_SIZE;
  }
  
  void push(int i){
      if(is_full()){
          stack_overflow();
      }
      else{
          contents[top++] = I;
      }
  
  int pop(void){
      if(is_empty()){
          stack_underflow();
      }
      else{
          return contents[--top];
      }
  }
  </code></pre>
  
  <p>I don't get 2 things here: </p>
  
  <ul>
  <li>how can the <code>make_empty()</code> function work? By just initializing <code>top</code> to 0, <code>contents</code> has still all its elements loaded in... shouldn't <code>contents</code> be initialized as well?</li>
  <li>what do the 2 <code>stack_overflow()</code> and <code>stack_underflow()</code> functions do? Is their behavior defined by default in <code>stdio.h</code>? If so, what happens when they get called? If not, am I supposed to define them by myself?</li>
  </ul>
  
  <p>Also, just out of curiosity, is there a library that defines all the stack functions already?</p>