Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
293 B
4
Indexable
Never
#include <iostream>

#define Log(item) std::cout << item << std::endl;

class A {
public:
	int x = 0;
};

class B : public A {
public:
	int y = 0;
};

int main() {
	B arr[2] = { A(), B() };

	Log(arr[0].x)
	Log(arr[0].y)
	Log(arr[1].x)
	Log(arr[1].y)

	std::cin.get();
}