system(variable) is it possible??
i want to make a c++ program that do something like this
string str; cin >> str; str="cat " + str; int rv=system(str); is there a way to do it? |
It should be fine, the only thing to watch out for is that you will probably need to convert the string to a character array check out the method c_str().
|
Also if the first arg in string addition is a string const you will need explicit construction:
Code:
string str; Code:
str.resize(512); Code:
#include <iostream> Code:
test.cpp |
All times are GMT -5. The time now is 06:15 PM. |