Untitled

 avatar
unknown
c_cpp
2 years ago
293 B
6
Indexable
#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();
}
Editor is loading...