diff options
| author | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:45 -0700 |
|---|---|---|
| committer | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:45 -0700 |
| commit | a33d49ac4d1ce554c72770927957a089b4023bf1 (patch) | |
| tree | 17ea036b5a0e8b488dc236f0ce48a275ecd80ef8 /cpp/structs.cpp | |
Diffstat (limited to 'cpp/structs.cpp')
| -rw-r--r-- | cpp/structs.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cpp/structs.cpp b/cpp/structs.cpp new file mode 100644 index 0000000..87be70c --- /dev/null +++ b/cpp/structs.cpp @@ -0,0 +1,19 @@ +#include <iostream> +#include <string> +using namespace std; + +struct dog { + int age; + int weight; + string color; + string name; +}; + +int main() { + dog atlas; + atlas.age = 7; + atlas.weight = 77; + atlas.color = "black"; + atlas.name = "Atlas"; + cout << atlas.color << endl; +} |
