C++程序出现了这种错误E:\1.cpp(18) : error C2018: unknown character '0xa1' 请问哪里错了要怎么改呀
#include<iostream>usingnamespacestd;classStudent{public:Student(intStudentNo=0){cout<...
#include<iostream>
using namespace std;
class Student
{public:
Student(int StudentNo=0)
{cout<<"creat one student\n";
NoOfStudents++;
cout<<"NoOfStudents "<<NoOfStudents;
StudentNo=9022100+NoOfStudents;
cout<<" StudentNo "<<StudentNo<<endl;
}
~Student()
{ cout<<"destruct one student \n";
NoOfStudents--;
}
static int number()
{return NoOfStudents;}
protected:
static int NoOfStudents;
int StudentNo;
};
int Student::NoOfStudents=0;
void fn()
{ Student s1;
Student s2;
cout<<Student::number()<<endl;
}
void main()
{fn();
cout<<Student::number()<<endl;
} 展开
using namespace std;
class Student
{public:
Student(int StudentNo=0)
{cout<<"creat one student\n";
NoOfStudents++;
cout<<"NoOfStudents "<<NoOfStudents;
StudentNo=9022100+NoOfStudents;
cout<<" StudentNo "<<StudentNo<<endl;
}
~Student()
{ cout<<"destruct one student \n";
NoOfStudents--;
}
static int number()
{return NoOfStudents;}
protected:
static int NoOfStudents;
int StudentNo;
};
int Student::NoOfStudents=0;
void fn()
{ Student s1;
Student s2;
cout<<Student::number()<<endl;
}
void main()
{fn();
cout<<Student::number()<<endl;
} 展开
2014-10-01
展开全部
转到出错地方 删掉中文字符
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询