My question should be simple and I've spent that last few hours trying to get an answer to it by figuring it out on my own (and google-ing) answers and getting nowhere.

I've got the following in my header file:

`Window.hpp`

```
typedef struct {
    SDL_Window* window = 0;
    const char* title = 0;
    int width;
    int height;
    int flags;
} m_windowStruct;

typedef std::map<std::string, m_windowStruct> m_windowMap;

m_windowMap windowMap; /* <-- Made this accessible */

```

and in my source file I've the following code:

`Window.cpp`

```
bool Window::createWindow(std::string id, const char* title, int width, int height, int flags) {
    m_windowMap* windowMap;
    m_windowStruct windowData;

    windowData.window = SDL_CreateWindow("insert window creation info here");

    if (!windowData.window) {
        windowData.title = title;
        windowData.width = width;
        windowData.height = height;
        windowData.flags = flags;
        windowMap->insert(m_windowMap::value_type(id, &windowData));
        SDL_LogInfo(INFO, "Window creation successful");
        return true;
    }
    else {
        return false;
    }
};

```

Which works all fine and dandy... The problem I'm having is accessing the mapped struct members after.

For example if I want the instance of the primary window I'd want the following function:

```
/* Returns the window instance from the mapped struct */
SDL_Window* Window::getWindow(std::string id) {
    m_windowMap::const_iterator keyValuePair = windowMap.find(id); /* <-- New error: Error: expression must have a class type */

    if (keyValuePair == windowMap.end()) { /* <-- same error as just above */
        return 0;
    }

    return keyValuePair->second.window; /* <-- Same error as just above */
};

```

I cannot for the life of me figure out how to access the second `window` member so that I can then give it to my renderer!

Any ideas?