Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] How to fixed the error of "request for member ‘*’ in ‘*’, which is of non-class type ‘const char [11]’ "

Subject: CGAL users discussion list

List archive

[cgal-discuss] How to fixed the error of "request for member ‘*’ in ‘*’, which is of non-class type ‘const char [11]’ "


Chronological Thread 
  • From: 魏华祎 <>
  • To:
  • Subject: [cgal-discuss] How to fixed the error of "request for member ‘*’ in ‘*’, which is of non-class type ‘const char [11]’ "
  • Date: Tue, 19 Feb 2013 21:42:14 +0800

Hi, there,

   I write a template function to use Geomview_stream to show a structure quad mesh. 

  typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
  typedef CGAL::Structure_quadrangulation_2<K> Grid_2;
  ....
  Grid_2  strgrid;
  gv<<strgrid;

 But there exist some errors when I compile it: 

   " request for member ‘rows’ in ‘quad’, which is of non-class type ‘const char [11]’ "
   "request for member ‘cols’ in ‘quad’, which is of non-class type ‘const char [11]’ "
  ..... 

But for my structure quad mesh class, it has  'rows()'  and 'cols()' as its memeber functions. Please help me to fix it. Thanks.

Best 

Huayi

PS: the following code is the my Geomview_stream code:

template<class SQuad >
void
show_quad(Geomview_stream &gv,const SQuad & quad)
{
    // Header.
    gv.set_ascii_mode();
    gv << "( geometry " << gv.get_new_id("quadrangulation")
       << "{ appearance { linewidth "
       << gv.get_line_width()<<" "<<"+edge"<<" "<<"-face"
       <<" }{MESH \n"
       << quad.cols() <<"\t"<<  quad.rows()<<"\n";

    for(int i = 0; i < quad.rows(); i++)
    {
        for(int j = 0; j < quad.cols(); j++)
        {
            gv<<quad.point(i,j)<<"\t";
        }
        gv<<"\n";
    }
    // Footer.
    gv << "}})";
}

template<class SQuad >
Geomview_stream&
operator<<( Geomview_stream &gv, const SQuad & quad)
{
    bool ascii_bak = gv.get_ascii_mode();
    bool raw_bak = gv.set_raw(true);

    show_quad(gv, quad);

    gv.set_raw(raw_bak);
    gv.set_ascii_mode(ascii_bak);
    return gv;
}





Archive powered by MHonArc 2.6.18.

Top of Page