I'm stuck at trying to pass a vector into system()
function.
I've read previous questions about this topic but I came out empty handed.
class aloha
{
private:
string str;
public:
void Caller() {
std::string line;
std::vector<string>vl;
std::ifstream file("data.txt");
while (file >> line) {
vl.push_back(line);
std::string c = "Taskkill /F /IM " (vl.begin(), vl.end())));
system(c.c_str()));
}
}
};
I got the following errors and it has driven me nuts:
||=== Build: Debug in Instruction (compiler: GNU GCC Compiler) ===| error: expression cannot be used as a function error: cannot convert 'std::basic_string<_CharT, _Traits, _Alloc>::c_str<char, std::char_traits<char>, std::allocator<char> >' from type 'const char* (std::basic_string<char>::)() const' to type 'const char*'|`
Thanks in advance, If you guys need any more info/sample code I'll put more.
Sorry I'm new to c++