View Single Post
  #7 (permalink)  
Old 07-28-2008, 09:46 AM
MeTh0Dz|Reb0rn MeTh0Dz|Reb0rn is offline
Banned
 
Join Date: Jul 2008
Posts: 127
Credits: 0
Rep Power: 0
MeTh0Dz|Reb0rn is an unknown quantity at this point
Default Re: using goto/if else and user input in C#

Ok this is C++....

Code:
#include <iostream>
using namespace std;

void Recursive_Function();

int main() {
    int i = 0;
    Recursive_Function();
    return 0;
}

void Recursive_Function() {
    cout << hello << " " << i++ << endl;
    Recursive_Function();
}
Basically what this does is call Recursive_Function() and then call it again when the function reaches its end. This is exemplified by the fact that i is printed and it's value increases by one each time the function is called. This can easily be implemented in C#.


Also I typed this all in the quick reply box, so if there is an error that's why.
Reply With Quote