I have a homework to do in C++, I'm trying to find if numbers from an array are perfect Square. Also, that array is dinamically allocated. Here is my code:
myVector perfectSquare(myVector *vect)
{
myVector rez;
rez.length = 0;
for (int i = 0; i < vect->length; i++)
if (vect[i] == sqrt(vect[i])*sqrt(vect[i])) // here it gives error
{
addToVector(&rez, vect->arr[i]);
}
return rez;
}