#include <iostream>
#include <cstring>
using namespace std;
class Array {
void *arr;
int size;
int index;
public:
Array(int array_size, int type_size)
:arr(nullptr), size(type_size), index(0) {
arr = new byte[array_size * type_size];
}
void append(void *data) {
memcpy(arr+index, data, size);
index+=size;
}
void * get(int n) {
return arr+(n*size);
}
};
int main() {
Array arrInt(10, sizeof(int));
int a=23;
int b=32;
arrInt.append(&a);
arrInt.append(&b);
cout << *(int*)arrInt.get(0) << endl;
cout << *(int*)arrInt.get(1) << endl;
Array arrChar(10, sizeof(char));
char c='C';
char d='D';
arrChar.append(&c);
arrChar.append(&d);
cout << *(char*)arrChar.get(0) << endl;
cout << *(char*)arrChar.get(1) << endl;
return 0;
}