大家帮帮忙.谢谢了
#include<iostream>using namespace std;
class str
{
int num;
char s[15];
public:
str(int x)
{
num =x;
}
void itoa();
void print()
{
cout<<"n="<<num<<endl;
cout<<"string="<<s<<endl;
}
};
void str::itoa()
{
int i=0;
int x=num;
while(x)
{
s[i]=x%10+'0';
x=x/10;
i++;
}
s[i]='\0';
int n=i-1;
for(i=0;i<=n/2;i++)
{
char c;
c=s[i];
s[i]=s[n-i];
s[n-i]=c;
}
}
main()
{
int n;
cout<<"input n:";
cin>>n;
str str(n);
str.itoa();
str.print();
return 0;
}
这个程序编译完了,是这个错误.我搞不懂,哪位能帮忙解决以下啊
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/正整数转换成字符串.exe : fatal error LNK1120: 1 unresolved externals