In Class1.cpp line 13, you should just use number or this->number. Corge.number doesn't make sense because Corge is not an object, it's a type.
In class2.cpp, if you want to use an array you should pass the size of the array as an additional parameter than use a for loop to go through each of the elements individually. I would just recommend using one of the standard containers though.
I think you do not need to pass any parameter because the function and the array are members of the same class. Just use a loop in the function to change all the values of the arrays.
#include <iostream>
class Corge
{
public:
std::string text;
int number;
Corge();
void changeNumber();
};
class Grault
{
Corge waldo[10];
void changeAll(Corge waldo); //This function is supposed to take a waldo object as argument.
};
int main()
{
Grault plugh;
for(int i = 0; i < 10; i++)
{
plugh[i].changeAll(plugh[i]);
}
Corge::Corge()
{
text = "Name";
number = 1;
}
void Corge::changeNumber()
{
std::cout << "Change number to: ";
std::cin >> Corge.number;
}
void Grault::changeAll(Corge waldo)
{
waldo.changeNumber();
}