@TaeHunKim/

EffectiveCppItem30

C++11

No description

fork
loading
Files
  • main.cpp

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9633531371479864","path":"main.cpp","file":{"path":"main.cpp","content":{"asEncoding":{"base64":"I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3Mgc3RyIHsKcHVibGljOgoJc3RyKCkgewoJCXN0ZDo6Y291dCA8PCAic3RyIGNvbnN0cnVjdG9yIiA8PCBzdGQ6OmVuZGw7Cgl9Cn07CgpjbGFzcyBCYXNlIHsKcHVibGljOgoJQmFzZSgpIHsKCQlzdGQ6OmNvdXQgPDwgIkJhc2UgY29uc3RydWN0b3IiIDw8IHN0ZDo6ZW5kbDsKCX0KCnByaXZhdGU6CglzdHIgYm0xLCBibTI7IC8vIGJhc2UgbWVtYmVycyAxIGFuZCAyCn07CgpjbGFzcyBEZXJpdmVkIDogcHVibGljIEJhc2UgewpwdWJsaWM6CglEZXJpdmVkKCkgewoJfSAvLyBEZXJpdmVk4oCZcyBjdG9yIGlzIGVtcHR5IOKAlCBvciBpcyBpdD8KCnByaXZhdGU6CglzdHIgZG0xLCBkbTIsIGRtMzsgLy8gZGVyaXZlZCBtZW1iZXJzIDHigJMzCn07CgppbnQgbWFpbigpIHsKCURlcml2ZWQgZDsKfQ=="},"asBuffer":null},"loaded":true}}
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
#include <iostream>

class str {
public:
	str() {
		std::cout << "str constructor" << std::endl;
	}
};

class Base {
public:
	Base() {
		std::cout << "Base constructor" << std::endl;
	}

private:
	str bm1, bm2; // base members 1 and 2
};

class Derived : public Base {
public:
	Derived() {
	} // Derived’s ctor is empty — or is it?

private:
	str dm1, dm2, dm3; // derived members 1–3
};

int main() {
	Derived d;
}