Create a gist now

Instantly share code, notes, and snippets.

@pathawks /BadAndWrong.cpp Secret
Last active Aug 29, 2015

Embed
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