diff options
| author | Aotrix <[email protected]> | 2026-10-07 22:49:15 +0200 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2026-10-07 22:49:15 +0200 |
| commit | 0d684f65b364baf8551acafccf7169a7af24ad93 (patch) | |
| tree | 46cda812567eec1e9601443438e4b6a6af9a157a /main.cc | |
| parent | be2826ed7596c7f82347af4f3908e8dce7558a6d (diff) | |
Add value parameter to function
Diffstat (limited to 'main.cc')
| -rw-r--r-- | main.cc | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,6 +1,7 @@ #include <iostream> -bool configValue(const std::string& iKey) +bool configValue(const std::string& iKey, + const std::string& iExpectedValue) { bool result; std::cin >> result; @@ -16,12 +17,12 @@ bool coucouEveryone() int main() { - std::string aValue{"aparam"}; - if (configValue(aValue)) + std::string aValue{"stari"}; + if (configValue(aValue, "on")) { coucouEveryone(); } - if (!configValue("")) + if (!configValue("burger", "on")) { std::cout << "Mouhahahaha I am a villain!\n"; } |
