Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Where do you include winboard stuff in your program?

Author: José Carlos

Date: 15:54:32 12/15/04

Go up one level in this thread


On December 15, 2004 at 15:10:18, Uri Blass wrote:

>On December 15, 2004 at 14:59:12, José Carlos wrote:
>
>>On December 15, 2004 at 13:47:43, Uri Blass wrote:
>>
>>>On December 15, 2004 at 13:00:35, Alessandro Scotti wrote:
>>>
>>>Hi Alessandro,
>>>I do not understand what is ::
>>>I never used it in code that I wrote but I can see it not only in your code but
>>>also in nalimov's code.
>>>
>>>It seems that both you and nalimov are smarter than me.
>>
>>  It doesn't have to do with being smart. The :: is the scope operator in C++.
>>If you have a class and define a function inside, in the cpp implementation
>>module you tell the compiler:
>>MyClass::MyFunct() so that it know you're defining the function inside the
>>class.
>>  You also use :: to specify something belongs to a namespace:
>>MyNameSpace::MyFunct()
>>
>>  José C.
>
>Thanks for the explanation but I use . for functions inside a class and not ::
>
>I have
>class TimeManagement t when t is a global class and I use t. when I need it.
>
>Uri

  I guess you have the code in the header (.h) file, thus inlined. In a typical
implementation, you'd do something like:

*** MyClass.h ***
class MyClass
{
  protected:
  int iValue;

  public:
  MyClass() : iValue(0) {} // Constructor; initialize iValue to zero
  void Set(int i);
}

*** MyClass.cpp ***
void MyClass::Set(int i) // You need to indicate to what class Set() belongs
{
  iValue = i;
}

  José C.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.