有人能指出代码中的错误吗?
73 POINT N;
74 N.x = (int) 1 - t * p1.X + t * p2.X;
75 N.y = (int) ((1 - t) * p1.Y + t * p2.Y);
76
77 return N;
我得到的错误是:
||=== Build: Debug in tester (compiler: GNU GCC Compiler) ===|
C:\CodeBlocks\openGL workspace\tester\main.cpp||In member function 'POINT drawDeCasteljau::getCasteljauPoint(int, int, double)':|
C:\CodeBlocks\openGL workspace\tester\main.cpp|74|error: expected unqualified-id before numeric constant|
C:\CodeBlocks\openGL workspace\tester\main.cpp|74|error: expected ';' before numeric constant|
C:\CodeBlocks\openGL workspace\tester\main.cpp|75|error: expected unqualified-id before numeric constant|
C:\CodeBlocks\openGL workspace\tester\main.cpp|75|error: expected ')' before numeric constant|
||=== Build failed: 4 error(s), 4 warning(s) (0 minute(s), 0 second(s)) ===|
我看到一些帖子有相同的错误..但是我看到没有帮助调试它。
答案 0 :(得分:1)
要做出准确的结论,这还不够。但似乎数据成员x和y要么是大写的X和Y,要么两者都是低的情况,对于所有变量N,p1和p2都是x和y,我认为它们的类型为POINT ..