i am trying to add an integer to the whole array of a class by operator overloading, but i am not sure how can i handle the integer.
void Data::operator +(const Data &c) const
{
for (int i = 0; i < c.size; i++)
{
c.integers[i]=c.integers[i]+ // how do i add the integer with every element of the array?
}
}
i am trying to get this to work.
data = data + 5;
Integers is an array which i have defined in data class.