initial
This commit is contained in:
31
classTest.cpp
Normal file
31
classTest.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <iostream>
|
||||
|
||||
class Max {
|
||||
private:
|
||||
int mInt1, mInt2;
|
||||
|
||||
public:
|
||||
int int1, int2;
|
||||
Max(int int1, int int2) :
|
||||
mInt1 {int1}, mInt2 {int2}
|
||||
{
|
||||
}
|
||||
|
||||
int bigger() {
|
||||
if (int2 >= int1) {
|
||||
return int2;
|
||||
} else {
|
||||
return int1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
int main(void) {
|
||||
int x = 5, y = 7;
|
||||
|
||||
Max max{x, y};
|
||||
|
||||
std::cout << max.bigger() << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user