Error in expected expression?

Here I tried to insert a value into the value of GLKVector2Add , but the error in the expected error is missing from this line.

 GLKVector2 self.position = GLKVector2Add({-200.695, 271},{-803.695, 0}); //Error - Expected expression 
+4
source share
2 answers

Try creating the " GLKVector2 " variables by setting them and then passing them as arguments in your " GLKVector2Add " call. Perhaps the compiler just does not know what to do with "{-200.695,271}" (a combination of floating point and integer numbers).

0
source

You must add them using GLKVector2Make .

So your code will be:

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

Source: https://habr.com/ru/post/1414712/


All Articles