using malloc and free in cpp
#include <iostream> #include <cstdlib> int main() { unsigned char* foo = reinterpret_cast<unsigned char*>(std::malloc(20)); std::cout << (unsigned)(*foo) << '\n'; std::free(foo); }