Created
September 13, 2016 15:03
-
-
Save mxrguspxrt/912256645907b8cfbd2c381c492f4c77 to your computer and use it in GitHub Desktop.
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
// Example program | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Inimene { | |
public: | |
int vanus; | |
Inimene(int vanusParam) { | |
vanus = vanusParam; | |
} | |
}; | |
int minVanus = 18; | |
bool tohibJuuaAlkoholi(Inimene* inimene) { | |
if (inimene->vanus > minVanus) { | |
cout << "Tohib juua alksi"; | |
return true; | |
} else { | |
cout << "Ei tohi"; | |
return false; | |
} | |
}; | |
int main() | |
{ | |
Inimene* inimene = new Inimene(21); | |
tohibJuuaAlkoholi(inimene); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment