c++11,字符串拼接 to_string

字符串+随机数字


#include
#include


std::string package()
{
     
  srand((unsigned)time(NULL));
  int suffix = rand();
  std::string package_result = "package_";
  package_result = package_result + std::to_string(suffix);
  std::cout << package_result;
  return package_result;
}

你可能感兴趣的:(c/c++)