A
Atropo
Hi all.
Having several strings how do i combine them to construct a command;
lets say to run the date command.
string str = "14/10/08 19:06:09";
strDD = str.substr(0,2);
strMM = str.substr(3,2);
strAA = str.substr(6,2);
strhh = str.substr(9,2);
strmm = str.substr(12,2);
strss = str.substr(15,2);
strtarget<<"date -u "<<strMM<<strDD<<strhh<<strmm<<strAA<<"."<<strss<<
" 2>&1 /dev/null;"<<endl;
system(strtarget);
Not sure if the problem it's syntax in the strtarget line (59). when
I compile i get this
rtchk.cpp: In function `int main (int, char **)':
rtchk.cpp:59: no match for `string & << const char[9]'
Thanks in advance. really appreciate any advise.
Having several strings how do i combine them to construct a command;
lets say to run the date command.
string str = "14/10/08 19:06:09";
strDD = str.substr(0,2);
strMM = str.substr(3,2);
strAA = str.substr(6,2);
strhh = str.substr(9,2);
strmm = str.substr(12,2);
strss = str.substr(15,2);
strtarget<<"date -u "<<strMM<<strDD<<strhh<<strmm<<strAA<<"."<<strss<<
" 2>&1 /dev/null;"<<endl;
system(strtarget);
Not sure if the problem it's syntax in the strtarget line (59). when
I compile i get this
rtchk.cpp: In function `int main (int, char **)':
rtchk.cpp:59: no match for `string & << const char[9]'
Thanks in advance. really appreciate any advise.