DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   [c++] ISO C++ forbids declaration of _ with no type (http://www.daniweb.com/forums/thread201604.html)

genepi Jul 4th, 2009 4:28 am
[c++] ISO C++ forbids declaration of _ with no type
 
class C1{
public:
    C1(const C2& c){  //line 14 (works fine if i remove this constructor)
    //...
    }
};

class C2{
public:
    C2(const C1& c){
    //...
    }
};

the compiler show me the following error:
prova.cpp:14: error: expected ‘,’ or ‘...’ before ‘&’ token
prova.cpp:14: error: ISO C++ forbids declaration of ‘C2’ with no type

siddhant3s Jul 4th, 2009 4:42 am
Re: [c++] ISO C++ forbids declaration of _ with no type
 
ISO C++ need you to explicitly mention the datatype after the 'const'.
At the moment of defining C1, C2 is not defined.
Read http://www.parashift.com/c++-faq-lit...html#faq-39.11


All times are GMT -4. The time now is 8:27 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC