Error: Pending Announcement

For now, all I have in the file DecisionTree.his

namespace DecisionTree
{
     public static double Entropy(int pos, int neg);
}

and Visual Studio already highlights publicand speaks

Error: Pending announcement.

What am I missing?

+5
source share
2 answers

public- access specifier. Access specifiers apply only inside the body class/struct, not inside namespace. In C ++ (unlike Java), it should be followed by a colon :inside the body class.

For instance,

class DecisionTree {  // <----- 'class' (not 'namespace')
public:  // <------ access specifier
  static double Entropy (int pos, int neg);
private:
  int i;
};
+8
source

, - , , . , , .

0

All Articles