#ifndef BASE_H
#define BASE_H
class base
{
public:
base();
struct baseInfo
{
int SlotCount[4];
};
private:
protected:
};
base::base()
{
}
#endif
This is my header file, but how do I access the struct and its members through an object of the base class(through main)? I cant find anything helpful through google search.
#include <iostream>
#include "base.h"
int main()
{
base obj;
obj.baseInfo::SlotCount[0] = 5;
system("PAUSE");
return 0;
}
This compiles fun but gives me an error after running it.
Run-Time Check Failure #2 - Stack around the variable 'obj' was corrupted.
Thanks