Problem 1:
Your problem stems from the fact that system is of signature:
int system (const char *command);
What you have is of type std::string.
One way to fix this is to build a new std::string and then get the char pointer using c_str().
string cmd("curl.exe -b cookie.txt -d test=");
cmd += line;
cmd += " http://example.com";
Then pass the content to system.
system(cmd.c_str());
Problem 2:
Reading data and passing it unvalidated and unclean to system will allow anyone using your program to run commands at the shell.
This is a security risk.