Link to home
Start Free TrialLog in
Avatar of jtjli
jtjli

asked on

C++ Newbie -- syntax error : missing ';' before identifier

I'm new to C++... and what i am doing now is to add a very simple class to an existing HelloWorld program (for Symbian..but shouldn't matter i guess?)

However, when i compile, it always says SYNTAX ERROR : MISSING ';' BEFORE IDENTIFIER 'GetCount'.  ... And obviously i'm not missing any semicolon.. please HELP!

counter.h
=================
#ifndef __COUNTER_H__
#define __COUNTER_H__

class Counter {
      public:
            static void Start(void);
            static TInt GetCount(void) const;  // TInt is the int type for Symbian SDK
      private:
            static TInt mycount;
};

#endif //__COUNTER_H__


counter.cpp
==================
#include "counter.h"

void Counter::Start() {
      Counter::mycount = Counter::mycount + 1;
}

TInt Counter::GetCount() const {
  return Counter::mycount;
}

-----------------------------------------------------

SOLUTION
Avatar of Arty K
Arty K
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial