Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: error: no m...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 45798 of 47031
Post > Topic >>

Re: error: no match for 'operator<<' in 'std::cout.std::basic_ostream<_CharT, _Traits>::operator<< [with _CharT = char, _Traits = std::char_traits<char>](k) << dispMyarr(k)'

by "Victor Bazarov" <v.Abazarov@[EMAIL PROTECTED] > May 7, 2008 at 02:17 PM

curiousEngine wrote:
> 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;

You're trying to output the result of calling two void functions.
Think about it.

> }
>
>
> return 0;
> }

V
-- 
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
 




 4 Posts in Topic:
=?windows-1252?B?ZXJyb3I6IG5vIG1hdGNoIGZvciCRb3BlcmF0b3I8PJIgaW4
curiousEngine <curious  2008-05-07 10:54:57 
Re: error: no match for =?windows-1252?Q?=91operator=3C=3C=92_?=
"Alf P. Steinbach&qu  2008-05-07 20:06:51 
Re: error: no match for 'operator<<' in 'std::cout.std::basic_os
"Victor Bazarov"  2008-05-07 14:17:38 
=?windows-1252?B?UmU6IGVycm9yOiBubyBtYXRjaCBmb3IgkW9wZXJhdG9yPDy
James Kanze <james.kan  2008-05-09 02:34:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:45:03 CDT 2008.