Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Assigning vectors  (Read 7515 times)

0 Members and 1 Guest are viewing this topic.

pechhenka

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Assigning vectors
« on: July 27, 2020, 08:29:26 pm »
Hello! I would not say that I am new to C ++, but this is the first time I have encountered this. I have the following code:

sf::Vector2f v(5.f, 5.f);
v = -v

And the compiler writes to me that I cannot perform such an assignment, because I allegedly assign different data types, namely sf::Vector2f= sf::Vector2<float>;

Help me please, how can I invert the signs of the axes of a vector.



P.S. ok, i found a error) i passed v as const sf::Vector2f& v, and of course i can't change it ;D ;D
« Last Edit: July 27, 2020, 09:02:00 pm by pechhenka »

 

anything