1.
if(i<){
monthNumber = "";
itoa(i+,iCharArray,);
monthNumber += iCharArray;
} else {
itoa(i+,iCharArray,);
monthNumber = iCharArray;
}
2.
int转string
int n = 0;
std::stringstream ss;
std::string str;
ss<<n;
ss>>str;
string转int
std::string str = "123";
int n = atoi(str.c_str());
#include "stdafx.h" #include <string>
#include <sstream> using namespace std;
void main()
{
// int 转 string
stringstream ss;
int n = ;
string str;
ss<<n;
ss>>str;
// string 转 int
str = "";
n = atoi(str.c_str());
}