error: no match for ‘operator<<’ in ‘std::cout.std::basic_ostream<_CharT, _Traits>::operator<< [with

C

curiousEngine

Is the problem with the 2 functions?? G++ gives such type of error.

#include <iostream>
using namespace std;

int i, j;
int myarr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9}, arr1[10] = {11, 12, 13,
14, 15, 16, 17, 18, 19, 20};

void dispMyarr(int l){
if ((myarr[l] % 3) ==0)
cout<<myarr[l];
else
cout<<"-";
}

void dispArr1(int l){
if((arr1[l] % 3) == 0)
cout<<arr1[l];
else
cout<<"-";
}
int main(int argc, char** argv)
{
for(int k = 0 ; k < 10; k++){
cout<<k<<dispMyarr(k)<<dispArr1(k)<<endl;
}


return 0;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top