title: Determining if a number is prime with recursion
body: <p>I am currently writing a function that uses recursion to see if a number is prime, and here is what I have so far: </p>
  
  <p>My declaration is </p>
  
  <pre><code>bool isPrime(int num, int divisor = 2);
  
  bool isPrime(int num, int divisor){
      if (num == 1){
          return true;
      }
      else{
          if (num%divisor == 0){
              return false;
          }
          else{
              if (divisor == num){
                  return false;
              }
          return isPrime(num, divisor++);
          }
      }
  }
  </code></pre>
  
  <p>I'm new to C++, so I'm not sure if that's how you set a parameter to start at a certain number. But when I run this function, visual studios crashes on me. Any ideas?</p>