Question: I can't get past this error from my codeblocks IDE. I will paste full code. but the error says: error: invalid operands of types 'void'

I can't get past this error from my codeblocks IDE. I will paste full code. but the error says:

"error: invalid operands of types 'void' and int to binary operator%'

can somebody fix this problem?

#include #include #include #include #include using std::cout; using std::cin; using std::endl;

// Function declarations and definitions void myFunc(int* array, unsigned int size){ cout << "["; for(int i = 0; i < size; ++i) { array[i] = srand(time(nullptr)) % 100; cout << " " << array[i]; } cout << " ]" << endl; }

int main() { int* myArray; unsigned int mySize;

cout << "Enter array size: "; cin >> mySize; int* theSize = new int[mySize];

myFunc(myArray, mySize);

delete[] myArray;

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!