C++ Program Help

I am programming in C++
The function of the program is the user puts in the computer name and the printer name, and it adds the printer as a new printer.
I created 2 string variables
a and b
printer and computer
simply running a cout statement the following works:
cout<< "rundll32 printui.dll,PrintUIEntry /if /b "<<a<<" /f %windir%\inf\ntprint.inf /r" <<b<<" /m "<<a<<"";
BUT to make this work to add a printer obviously a system(" ") command must be used
system("rundll32 printui.dll,PrintUIEntry /if /b <<a<< /f %windir%\inf\ntprint.inf /r <<b<< /m <<a<<");
After user inputs a and b the program runs
but the output says "<< was unexpected here"
If i break the quotes like so:
system("rundll32 printui.dll,PrintUIEntry /if /b" <<a<< "/f %windir%\inf\ntprint.inf /r " <<b<< "/m" <<a<<"");
the program wont compile. Obviously this format is incorrect for a system command
So how do i escape the quotation marks?
I know its probably a backslash or a set of 'single quotes' somewhere, but everything i try doesn't work
Thanks for any help
The function of the program is the user puts in the computer name and the printer name, and it adds the printer as a new printer.
I created 2 string variables
a and b
printer and computer
simply running a cout statement the following works:
cout<< "rundll32 printui.dll,PrintUIEntry /if /b "<<a<<" /f %windir%\inf\ntprint.inf /r" <<b<<" /m "<<a<<"";
BUT to make this work to add a printer obviously a system(" ") command must be used
system("rundll32 printui.dll,PrintUIEntry /if /b <<a<< /f %windir%\inf\ntprint.inf /r <<b<< /m <<a<<");
After user inputs a and b the program runs
but the output says "<< was unexpected here"
If i break the quotes like so:
system("rundll32 printui.dll,PrintUIEntry /if /b" <<a<< "/f %windir%\inf\ntprint.inf /r " <<b<< "/m" <<a<<"");
the program wont compile. Obviously this format is incorrect for a system command
So how do i escape the quotation marks?
I know its probably a backslash or a set of 'single quotes' somewhere, but everything i try doesn't work
Thanks for any help
