init
This commit is contained in:
19
cpp/structs.cpp
Normal file
19
cpp/structs.cpp
Normal file
@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user