Examlex

Solved

Explain the Error in the Following Code

question 26

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);
//...
}


Definitions:

Social Darwinist

A belief system that applies Darwin's theory of natural selection to society, suggesting that humans compete in a struggle for existence in which only the fittest survive.

Dawes Act

A 1887 U.S. law aimed at assimilating Native Americans into American society by distributing tribal lands to individual members.

Haymarket Affair

A violent confrontation between police and labor protesters in Chicago in 1886, which became a symbol of the struggle for workers' rights.

Related Questions