Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions