[求助]大写写字母有区别吗
我写了一段程序如下:
#include <iostream>
using namespace std;
class Point {
public:
Point(int xx=0, int yy=0) {X=xx; Y=yy; countP++; }
Point(Point &p);
int GetX() {return X;}
int GetY() {return Y;}
void getc() {cout<<" Object id="<<countP<<endl;}
private:
int X,Y;
static int countP;
};
Point::Point(Point &p)
{X=p.X;
Y=p.Y;
countP++;
}
int Point::countP=0;
void main()
{Point A(4,5);
cout<<"Point A,"<<A.GetX()<<","<<A.GetY();
A.getc();
Point B(A);
cout<<"Point B,"<<B.GetX()<<","<<B.GetY();
B.getc();
}
编译时总是出错,然后我把函数void getc改为void Getc,仅仅是变动了一个大小写字母,再编译是竟然没有错了,请问这是为什么呀!谢谢!
[此贴子已经被作者于2007-8-27 3:11:53编辑过]