+ 1
how come an additional number is printed: the size 3? see my code below
int printarray(int arr[], int size) { for(int x=0; x<size; x++) { cout <<arr[x]<< endl; } } int main () { int myarr[]={53, 99, 505}; cout <<printarray(myarr, 3);/*output: 53 99 505 3 */ }
1 Respuesta
+ 6
Remove 'cout << ' at line
cout <<printarray(myarr, 3);