diff options
| author | Carlos Maiolino <[email protected]> | 2025-07-10 22:24:20 +0200 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-07-10 22:24:20 +0200 |
| commit | 869e68986aa8f69af6e7842260a68d1e5c6f796f (patch) | |
| tree | 63b6b5ffc3d19414233d4629a533c0d9bf3cbf72 /CPP/Basics/main.cpp | |
| parent | 20834dcc57537cd95260a4a22f5d91a027adfd35 (diff) | |
Add a bunch of code
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'CPP/Basics/main.cpp')
| -rw-r--r-- | CPP/Basics/main.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/CPP/Basics/main.cpp b/CPP/Basics/main.cpp new file mode 100644 index 0000000..1b6d751 --- /dev/null +++ b/CPP/Basics/main.cpp @@ -0,0 +1,25 @@ +#include <iostream> +#include <string> +#include "cow.h" + +int main(void) { + cow *my_cow; + my_cow = new cow("Hildy", 7, PET); + + std::cout << my_cow->get_name() << " is a type - " << + (int)my_cow->get_purpose() << + std::endl; + + std::cout << my_cow->get_name() << " is " << + my_cow->get_age() << " years old" << + std::endl; + + + my_cow->set_age(24); + std::cout << my_cow->get_name() << " is NOW " << + my_cow->get_age() << " years old" << + std::endl; + + delete my_cow; + return 0; +} |
