-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChe-cosa-sono-le-classi.cpp
More file actions
51 lines (34 loc) · 1000 Bytes
/
Copy pathChe-cosa-sono-le-classi.cpp
File metadata and controls
51 lines (34 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <string>
using namespace std;
// Classi
// Link: https://youtu.be/ULpr1Z0WEtQ
// Title: Что такое класс. Что такое объект класса. Экземпляр класса это. Класс ООП это. Урок #73
// Creator: #SimpleCode
//
class Human // questa è una classe
{
public:
int age;
float weight;
string name;
};
int main() {
setlocale(LC_ALL, "italian");
Human firstHuman; // questo è un oggetto di classe Human
firstHuman.age = 30;
firstHuman.name = "Anton Whitless";
firstHuman.weight = 50.43f;
cout << firstHuman.age << endl;
cout << firstHuman.name << endl;
cout << firstHuman.weight << endl;
cout << "\n_____________________\n";
Human secondHuman; // un'altro oggetto
secondHuman.age = 19;
secondHuman.name = "Gladd Flier";
secondHuman.weight = 67.93f;
cout << secondHuman.age << endl;
cout << secondHuman.name << endl;
cout << secondHuman.weight << endl;
return 0;
}