In many articles have I read about pointers being a lot easier to pass than strings and should usually be used when using classes and such. But there is a lot more code involved when making this happen. Take the below example:
This compared to:Code:wxString input = InputBox->GetValue(); //Get value from input box. wxString* output = grid->Encode(&input); //Receive pointer from function. OutputBox->SetValue( *output ); //Print that pointers variables value delete output; //Deallocate output.
wxString is simply a STD String except a few modifications from wxWidgets team.Code:OutputBox->SetValue(grid->Encode( InputBox->GetValue() ) ); //Encode uses return string from GetValue() and SetValue uses return string of Encode