Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > 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)’

Reply
Thread Tools

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)’

 
 
curiousEngine
Guest
Posts: n/a
 
      05-07-2008
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;
}
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      05-09-2008
On May 7, 8:06 pm, "Alf P. Steinbach" <(E-Mail Removed)> wrote:
> * curiousEngine:


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


> Don't put your question only in subject line.


> Don't put critical information in the subject line.


And try to keep the subject line a reasonable length.

--
James Kanze (GABI Software) email:(E-Mail Removed)
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
std::basic_string<_CharT> ( is a dependent scope?) eric C++ 1 07-08-2011 07:31 AM
What are those _Traits for? Vince C. C++ 7 07-16-2007 09:48 PM
Problem with std::basic_istream<_Elem,_Traits> &std::getline() Bit Byter C++ 2 04-13-2006 02:38 PM
$match = true() for empty $match?? Victor XML 2 05-17-2004 10:43 AM
Java regex can't match lengthy match? hiwa Java 0 01-29-2004 10:09 AM



Advertisments