expression:
static_cast <size_t> (mem + bytesAlreadyAllocated)
applies offset using the undefined size ( void) type. since voidit has no size, the program is poorly formed.
char*is a suitable pointer for your use in this scenario. eg:
`char* mem;`
char* addr(mem + bytesAlreadyAllocated);
Update
So, in the following program:
#include <iostream>
int main(int argc, const char* argv[]) {
const int array[3] = {-1, 0, 1};
std::cout << *(array + 0) << ", "
<< *(array + 1) << ", " << *(array + 2) << "\n";
return 0;
}
-1, 0, 1. . void - .