I hope you realize that it is working because you allocated memory for currAction. There is nothing wrong with declaring currAction like you were doing before. It's just that you HAVE to allocate memory before dereferencing a currAction.
1 2 3 4 5 6 7 8 9
action *currAction ; // fine
currAction->commandText = "String" ; // problem, since the memory for currAction is not allocated.
currAction = new action; // memory for currAction allocated
currAction->commandText = "String"; // now OK