Solved

Explain the Error in the Following Code

Question 22

Essay

Explain the error in the following code.You may give the warning message,or error message,your compiler might give for the following error,or you may describe the error.However you present the error,you must explain clearly what is wrong.
#include <iostream>
//Test question
void show_array(int ar[],int size)
{
using namespace std;
for(int i = 0;i < size;i++)
cout << ar[i] << " ";
cout << endl;
}
int main()
{
const int a[6] = {2,4,2,3,5};
show_array(a,6);
//...
}

Correct Answer:

verifed

Verified

void show_array(int ar[],int size)
{ //^...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents