A
Atropo
sorry if this comes out more than once. i've posted this three times
but never shows.
Hi all,
Having several strings how do I construct variable to pass to
system():
Lets say the date command
string str = "14/10/08 19:06:09";
strDD = str.substr(0,2);
strMM = str.substr(3,2);
strYY = str.substr(6,2);
strhh = str.substr(9,2);
strmm = str.substr(12,2);
strss = str.substr(15,2);
// I would like contruct date -u 1014190608.09 2>&1 > /dev/
null
strT<<"date -u "<<strMM<<strDD<<strhh<<strmm<<strYY<<"."<<strss<< "
2>&1 >/dev/null;"<<endl;
system(strT);
when I compile it throws
rtchk.cpp: In function `int main (int, char **)':
rtchk.cpp:59: no match for `string & << const char[9]'
so i could be a syntax error, but I'm newbie and don't know.
if there is a typo, I can't see it.
but never shows.
Hi all,
Having several strings how do I construct variable to pass to
system():
Lets say the date command
string str = "14/10/08 19:06:09";
strDD = str.substr(0,2);
strMM = str.substr(3,2);
strYY = str.substr(6,2);
strhh = str.substr(9,2);
strmm = str.substr(12,2);
strss = str.substr(15,2);
// I would like contruct date -u 1014190608.09 2>&1 > /dev/
null
strT<<"date -u "<<strMM<<strDD<<strhh<<strmm<<strYY<<"."<<strss<< "
2>&1 >/dev/null;"<<endl;
system(strT);
when I compile it throws
rtchk.cpp: In function `int main (int, char **)':
rtchk.cpp:59: no match for `string & << const char[9]'
so i could be a syntax error, but I'm newbie and don't know.
if there is a typo, I can't see it.