How to get HWID in C++

I’m making a program, to stop pirating i’m adding a hwid lock. I want to use the output of the wmic command wmic csproduct get uuid. However I am not sure how to set its output as a variable.