Question: I have a class that contains some data: `class DATA`

Now I would to create some functions that uses those data. I can do it easily by writing member functions like `DATA::usedata();`

Since there are hundreds of functions, I would to keep an order in my code, so I would like to have some "categories" (not sure of the correct name) like:

```
DATA data;
data.memory.free();
data.memory.allocate();
data.file.import();
data.whatever.foo();

```

where `memory`, `file` and whatever are the "categories" and `free`, `allocate` and `foo` are the functions.

I tried the inheritance way, but I got lost since I can not declare inside DATA a memory or file object, error C2079 occurs: <http://msdn.microsoft.com/en-us/library/9ekhdcxs%28VS.80%29.aspx>

Since I am not a programmer please don't be too complicated and if you have an easier way I am all ears.

Answer: 
The easiest way would be to do the categories just as a naming convention. If you replace the `.` with `_` you don't need any "subobjects" and get:

```
data.memory_free();
data.memory_allocate();

data.file_import();

```

This way you basically have the same function names but avoid all the implementation problems of the subobject approach.
```
class DATA
{
public:
    class CategoryA_Class
    {
        friend DATA;

    private:
        CategoryA_Class() { }

    public:
        bool GiveMeSomeInt() { return 1; }
    };

    class CategoryB_Class
    {
        friend DATA;

    private:
        CategoryB_Class() { }

    public:
        bool GiveMeSomeBool() { return true; }
    };

public:
    CategoryA_Class CategoryA;
    CategoryB_Class CategoryB;
};

int _tmain(int argc, _TCHAR* argv[])
{
    DATA mydata;

    int a = mydata.CategoryA.GiveMeSomeInt();
    bool b = mydata.CategoryB.GiveMeSomeBool();

    return 0;
}

```