Hi!
I don't understand why but i still got that problem. I just made a test
if the string could be executed correctly by just making
cout << "\n" << FullString;
and i tested this string manually and it worked.
StringToConvert[0] = "sfftobmp -t
/var/spool/capisuite/users/tamer/received/fax-";
StringToConvert[1] = static_cast<char>(CharNextNo);
StringToConvert[2] = ".sff
/var/spool/capisuite/users/tamer/received/ToPrint.tiff";
FullString.assign(StringToConvert[0]);
FullString.append(StringToConvert[1]);
FullString.append(StringToConvert[2]);
//cout << "\n" << FullString << "\n";
system(FullString.c_str());
Output:
tamer@linux:~/Desktop/CapiSuitePrint> ./a.out
Error open file.
I really don't know what to do now.
Rolf said:
Tamer Higazi wrote:
Dear Peter,
How do i run correctly the function?!
"Fullsting" is a variable of string.
FullString.assign(StringToConvert[0]);
FullString.append(StringToConvert[1]);
FullString.append(StringToConvert[2]);
You could write this a bit cleaner with using operators:
FullString = StringToConvert[0];
FullString += StringToConvert[1];
FullString += StringToConvert[2];
or even:
FullString = StringToConvert[0] +
StringToConvert[1] +
StringToConvert[2];
Try:
system(FullString.c_str());