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

Discussion in 'C++' started by curiousEngine, May 7, 2008.

  1. 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;
    }
     
    curiousEngine, May 7, 2008
    #1
    1. Advertising

  2. curiousEngine

    James Kanze Guest

    On May 7, 8:06 pm, "Alf P. Steinbach" <> 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:
    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
     
    James Kanze, May 9, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bit Byter
    Replies:
    2
    Views:
    710
    Tom Widmer
    Apr 13, 2006
  2. Martin T.
    Replies:
    7
    Views:
    820
    Martin T.
    Mar 10, 2008
  3. saurabh29789

    Sending std::cout to std::cout !!

    saurabh29789, Jun 11, 2009, in forum: C++
    Replies:
    1
    Views:
    293
    Harald Finster
    Jun 11, 2009
  4. saurabh29789

    Sending std::cout to std::cout

    saurabh29789, Jun 11, 2009, in forum: C++
    Replies:
    2
    Views:
    343
    Rolf Magnus
    Jun 12, 2009
  5. eric
    Replies:
    1
    Views:
    940
    Michael DOUBEZ
    Jul 8, 2011
Loading...

Share This Page