summaryrefslogtreecommitdiff
path: root/cpp/structs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/structs.cpp')
-rw-r--r--cpp/structs.cpp19
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;
+}