这个程序怎么运行不了啊?
#include<iostream>
using namespace std;
void main()
{
int i,flag=1;
long s=0;
char *str;
cout<<"please input the string:";
cin>>str;
if(*str=='-')
{
flag=-1;
str++;
}
while(*str!='\0')
{
i=*str-'0';
s=10*s+i;
str++;
}
s=flag*s;
cout<<"=========================\n";
cout<<s;
}
输入12345 怎么运行不出来啊???