c++11、文字列接合to_string

2049 ワード

文字列+乱数

#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;
}