I do not understand why the pointer addition is failing.
char *pipebuf=new char[40001];
CommandRobot *cr= (CommandRobot*)pipebuf;
cr->command=2;
DWORD *rooms=(DWORD*)(cr+1);
*rooms=100;
For some reason after executing the value of pipebuf only contains the value of command, it does not contain the value of 100;
Yet, when I remove the new keyword to make it not a dynamic pointer, it works fine...Why?
DWORD is an unsigned int
Command is a class with a DWORD variable of command.. something like this
Class Command {
public:
DWORD command;
};