-
Notifications
You must be signed in to change notification settings - Fork 1
/
Lab_solution_02.cpp
37 lines (32 loc) · 1.07 KB
/
Lab_solution_02.cpp
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
#include <iostream>
#include <string>
class DeviceClass
{
public:
int m_systemID = 0x100;
bool m_isConnected = false;
std::string TestString()
{
return "Hello World!";
}
};
struct DeviceSturct
{
int systemID = 0x100;
bool isConnected = false;
std::string TestString()
{
return "Hello World!";
}
};
int main()
{
DeviceClass myDeviceClassObject;
std::cout << "myDeviceClassObject::systemID: " << myDeviceClassObject.m_systemID << "\n";
std::cout << "myDeviceClassObject::isConnected: " << myDeviceClassObject.m_isConnected << "\n";
std::cout << "myDeviceClassObject::TestString: " << myDeviceClassObject.TestString() <<"\n";
DeviceSturct myDeviceStructObject;
std::cout << "\nmyDeviceStructObject::systemID: " << myDeviceStructObject.systemID << "\n";
std::cout << "myDeviceStructObject::isConnected: " << myDeviceStructObject.isConnected << "\n";
std::cout << "myDeviceStructObject::TestString: " << myDeviceStructObject.TestString() <<"\n";
}