You don't actually have to allocate these on the heap here. You can just allocate them on the stack and pass their addresses to PDiffCompare. The only thing that needs to be allocated on the heap is the buffer for the error string:

```C++
//I'm assuming we're compiling using the C++-11 standard here... if it's C++-98, then unique_array will have to be a naked pointer, and 
//you better remember to free it and the initializers for the for the structs should be default constructor invocations.

std::unique_array<char> buffer = new char[80];
PDiffCompareParameters params = {0};
PDiffCompareResult result = {0};

params.PathToImageA = cImage1path;
params.PathToImageB = cImage2path;

int status = PDiffCompare(&params, &result);
return status;
```