View Single Post
Join Date: Nov 2008
Posts: 7
Reputation: Nickyu0712 is an unknown quantity at this point 
Solved Threads: 0
Nickyu0712 Nickyu0712 is offline Offline
Newbie Poster

Class declaration syntax error

 
0
  #1
Nov 23rd, 2008
  1. #include <string.h>
  2.  
  3. class ITEM //here i get the error
  4. {
  5. private:
  6. int price;
  7. char name[ 21 ];
  8. int efatr[ 4 ];
  9. public:
  10. void setName( char* newname );
  11. void setPrice( int newprice );
  12. void setAtribut( int x, int ef );
  13. ITEM()
  14. {
  15. name = "Player";
  16. price = 0;
  17. }
  18. ~ITEM();
  19. char* getName();
  20. int getPrice();
  21. ITEM_atribut getAtribut();
  22. }
  23.  
  24.  
  25.  
  26. void ITEM::setName( char* newname )
  27. {
  28. strcpy( name, newname );
  29. }
  30.  
  31. void ITEM::setPrice( int newprice )
  32. {
  33. price = newprice;
  34. }

i get a declaration syntax error at the class
Whats the problem??
Reply With Quote