4
这里我试图在GLKVector2Add
的值中插入一个值,但是错误是在这一行中缺少预期的表达式。预期表达式中出现错误?
GLKVector2 self.position = GLKVector2Add({-200.695, 271},{-803.695, 0}); //Error - Expected expression
这里我试图在GLKVector2Add
的值中插入一个值,但是错误是在这一行中缺少预期的表达式。预期表达式中出现错误?
GLKVector2 self.position = GLKVector2Add({-200.695, 271},{-803.695, 0}); //Error - Expected expression
尝试创建“GLKVector2
”变量,设置它们,然后通过那些作为变量,你的电话为“GLKVector2Add
”。这可能是编译器根本不知道如何处理“{-200.695,271}”(浮点数和整数的混合)。
您必须使用GLKVector2Make
添加它们。
所以,你的代码将是:
GLKVector2 position = GLKVector2Add(
GLKVector2Make(-200.695, 271),
GLKVector2Make(-803.695, 0));
感谢您的回复。 – SampathKumar