adding a variable of the class inside itself [on hold]

im a noob at cpp, so don't be afraid to point out every little thing im doing wrong.

im trying to create a variable of a class inside itself. the code should speak for itself.

class Member { public:     Member();     Member winTo;     Member loseTo;     void setLoseTo(Member l);     void setWinTo(Member w); }; 

this is the error im getting:

In file included from main.h:4:0,                  from main.cpp:2: member.h:8:9: error: field ‘winTo’ has incomplete type ‘Member’   Member winTo;          ^ member.h:4:7: note: definition of ‘class Member’ is not complete until the closing brace  class Member        ^ member.h:9:9: error: field ‘loseTo’ has incomplete type ‘Member’   Member loseTo;          ^ member.h:4:7: note: definition of ‘class Member’ is not complete until the closing brace  class Member 

thank you.

Replay

Category: c++11 Time: 2016-07-29 Views: 0
Tags: c++11

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.132 (s). 12 q(s)