定义
int Widths(RECT rect) //矩形的宽度
{return (rect.right - rect.left);}
调用
if(Widths(Map.Rect[Start][StartNum - 1]) > Widths(Map.Rect[End][EndNum - 1]))
编译的错误信息是:
d:\program files\msdev98\myprojects\hanoi1\games.h(178) : error C2065: 'Widths' : undeclared identifier
D:\Program Files\MSDev98\MyProjects\Hanoi1\Games.cpp(19) : error C2373: 'Widths' : redefinition; different type modifiers
int Widths(RECT rect) //矩形的宽度
{return (rect.right - rect.left);}
调用
if(Widths(Map.Rect[Start][StartNum - 1]) > Widths(Map.Rect[End][EndNum - 1]))
编译的错误信息是:
d:\program files\msdev98\myprojects\hanoi1\games.h(178) : error C2065: 'Widths' : undeclared identifier
D:\Program Files\MSDev98\MyProjects\Hanoi1\Games.cpp(19) : error C2373: 'Widths' : redefinition; different type modifiers
static int Widths(RECT rect) //矩形的宽度
{return (rect.right - rect.left);}
不要把Widths函数放在头文件中!