This does not work because you pass the C ++ string to the system () C function. c_str () may help, but you should apply it to the whole line:
system(("curl.exe -b cookie.txt -d test="+line+" http://example.com").c_str());
, system() , , , . , , , . - "escape" spawn()/exec()/whatever else, .