Background:
I'm currently working my way through the edX | Intermediate C++ course. Although the course is being led by Microsoft, it did not state that you would need to use their IDE Visual Studios to complete successfully. I only have a Mac, so I did the introduction course using Xcode with no worries at all.
Question:
During the first module of the intermediate course, it states you can declare a class inside your header as static like so:
// Math.h
// Header file for the Math class
#pragma once
// Math class definition
static class Math
{
public:
// given base and exponent, calculate value
static int Math::pow(int base, int exp);
};
Xcode flagged errors saying that:
'static' is not permitted on a declaration of a type
According to a previous SO question asked here, this is not possible to do but I'm unsure if this has changed since the question was answered in 2008 or maybe this is compiler specific/VS feature which has been added by Microsoft to confuse people.