-
-
Save pathawks/b37a24c413abcd5253d2 to your computer and use it in GitHub Desktop.
Counting away from the Base Case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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