Skip to content

Instantly share code, notes, and snippets.

@pathawks
Last active August 29, 2015 14:17
Show Gist options
  • Save pathawks/b37a24c413abcd5253d2 to your computer and use it in GitHub Desktop.
Save pathawks/b37a24c413abcd5253d2 to your computer and use it in GitHub Desktop.
Counting away from the Base Case
/**
* Counting away from the Base Case
*
* @author: Pat Hawks
* Course: COMP B12
* Created on: Mar 15, 2015
* Source File: BadAndWrong.cpp
*/
#include <iostream>
using namespace std;
void recFun(char u)
{
if (u == 1)
cout << "Stop!" << endl;
else
{
cout << static_cast<int>(u) << endl;
recFun(u - 1);
}
}
int main(void)
{
recFun(-6);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment