You need to read documentation on CreateProcess() carefully. Second argument is marked as inout
, meaning the function would (in this case, could) modify the value pointed to.
If you're going to make a cast the way you mention in comments, it is better to not only add a comment but also probably use ANSI function explicitly (thus calling CreateProcessA()
) just in case.
Also, Qt has its own way of creating processes. You could refer to QProcess documentation.