简体   繁体   中英

Error comes in Expected expression?

在这里,我尝试在GLKVector2Add值中插入一个值,但错误在此行中缺少预期的表达式。

GLKVector2 self.position = GLKVector2Add({-200.695, 271},{-803.695, 0});  //Error - Expected expression

Try creating " GLKVector2 " variables, setting them and then passing those as arguments in your call to " GLKVector2Add ". It may be that the compiler simply doesn't know what to do with "{-200.695,271}" (a mix of float and integer numbers).

You must add them using GLKVector2Make .

So, your code will be:

GLKVector2 position = GLKVector2Add(
                      GLKVector2Make(-200.695, 271), 
                      GLKVector2Make(-803.695, 0));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM