随笔分类 -  C++ Programming

摘要:一些成员函数改变对象,一些成员函数不改变对象。例如:int Point::GetY(){ return yVal;} 这个函数被调用时,不改变Point对象,而下面的函数改变Point对象:void Point:: SetPt (int x, int y){ xVal=x; yVal=y;} 为了使成员函数的意义更加清楚,我们可在不改变对象的成员函数的函数原型中加上const说明: class Point { public: int GetX() const; int GetY() const; void SetPt (int, int); void OffsetPt (int, i... 阅读全文
posted @ 2013-07-09 20:09 2011winseu 阅读(272) 评论(0) 推荐(0)
摘要:三天之内把伟大的Vibe算法搞懂了,今天用了一上午的时间把Vibe写了出来,结果一运行提示了一个“stack overflow”的错误,当时我那个心力憔悴呀。各种查找,各种百度,最后还是找到了相应的答案,在此记录一下,以作以后使用,对于我对伟大的Vibe算法的理解,稍后将会奉上://////////////c用malloc和free//////////////////////////////#i nclude "stdio.h"#i nclude "stdlib.h"void main(){ int **p; int i,j; //p[4][8]//开始 阅读全文
posted @ 2012-07-20 18:50 2011winseu 阅读(815) 评论(1) 推荐(0)