[c++] ISO C++ forbids declaration of _ with no type

Reply

Join Date: Jul 2009
Posts: 1
Reputation: genepi is an unknown quantity at this point 
Solved Threads: 0
genepi genepi is offline Offline
Newbie Poster

[c++] ISO C++ forbids declaration of _ with no type

 
0
  #1
Jul 4th, 2009
  1. class C1{
  2. public:
  3. C1(const C2& c){ //line 14 (works fine if i remove this constructor)
  4. //...
  5. }
  6. };
  7.  
  8. class C2{
  9. public:
  10. C2(const C1& c){
  11. //...
  12. }
  13. };

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
Last edited by genepi; Jul 4th, 2009 at 4:40 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 791
Reputation: siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of siddhant3s has much to be proud of 
Solved Threads: 134
siddhant3s's Avatar
siddhant3s siddhant3s is offline Offline
Master Poster

Re: [c++] ISO C++ forbids declaration of _ with no type

 
0
  #2
Jul 4th, 2009
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
Siddhant Sanyam
(Not posting much)
Migrate to Standard C++ :When to tell your C++ Code is Non-Standard.
Please Read before posting: How To Ask Questions The Smart Way
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC