title: Testing User Defined Header File and other questions
body: <p>I have a question about testing user-defined header file.
  So, here is the example.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namesapce std;
  
  #include "header.h"
  #include "header.h" // I wonder the reason why I need to write this down two time for testing ifndef test.
  
  int main() 
  {
    cout &lt;&lt; "Hello World!" &lt;&lt; endl;
    cin.get();
  }
  </code></pre>
  
  <p>I learned that I need to write down user-defined header file's name in driver.cpp two times. But, I cannot understand the reason why I need to do that.</p>
  
  <p>And, here is the second question.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namesapce std;
  
  int main()
  {
    fstream fin;
    fin.open("info.txt");
  
    if(!fin.good()) throw "I/O Error\n"; // I want to know what throw exactly do.
    else cout &lt;&lt; "Hello World!\n";
  
    cin.get();
  }
  </code></pre>
  
  <p>So, my question is the function of throw.
  I realized that if I use throw instead of cout, my compiler would be terminated.
  I want to know what does throw exactly do.</p>
  
  <p>Since I am new to be here, I might have made some mistake about formatting and some rules, so feel free to point them out if I made it.</p>
  
  <p>Thank you !</p>