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
// 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started