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