In reply to cgales:
In reply to Yasmine4:
You have declared MyVector as constant, which prevents you from making any changes to it, hence the error. Remove the ‘const’ qualifier from MyVector and everything works.
Hello cgales,
thank you for your answer, but I tried that and it still displays the same error sadly.