HCL Interview Question
Software Engineer / DevelopersCountry: India
Interview Type: Phone Interview
You can't (safely) because int is generally of size 4 bytes (unless you're targeting some legacy 16bit CPU chipset).
int* vars = reinterpret_cast<int*>( new BYTE[10] );
Would be the way to do it but seriously, it's not something anyone should be doing unless they wish to wilfully corrupt the heap...
Would this work?
- houseUrMusic August 12, 2013