Please fill in the blank bolded below that would be the best choice for this program.
#include <iostream>
using namespace std;
const int size = 100000;
class TheBig
{ public:
double operator[](int index) const {return (theData[index]);}
private:
double theData[size];
};
void firstToBeThe(
______________________________________________________)
{
for (int i = 0; i <size; i++)
cout << value[i] <<endl;
}
int main()
{
TheBig one;
firstToBeThe(one);
}
In this code, as we can see the mains call the function firstToBeThe(one) here the one is a class object hence the function will also contain a class object in order to catch the parameter value
and in that function value was used inside as a variable undefined hence we use TheBig value as the answer
#include <iostream>
using namespace std;
const int size = 100000;
class TheBig
{ public:
double operator[](int index) const {return (theData[index]);}
private:
double theData[size];
};
void firstToBeThe(TheBig value) // because calling was done with object of a class
{
for (int i = 0; i <size; i++)
cout << value[i] <<endl; //value wasn't declared hence name came from here
}
int main()
{
TheBig one;
firstToBeThe(one); //object used as parameter passed
}
Get Answers For Free
Most questions answered within 1 hours.