If you need to concatenate variables of different types to form a string, use a stringstream object. The header
#include void concat(std::string &result){ long x = 1000; double y = 5.5.; std::stringstream s; s << "(" << x << "," << y << ")"; s>>result; // result is now "(1000,5.5)"}