Association C++

Any example Association relationship in Object Oriented c++ program?
Last edited on
Please tell to the unschooled one, what is an "Association relationship"?
std::map is an associative container. See:

http://www.cplusplus.com/reference/map/map/?kw=map

See this for more:

http://www.cplusplus.com/reference/stl/
Built-in arrays map numbers 0-N to a value. N must be known at compile time.

std::vector<> maps numbers 0-N to a value. N is determined at runtime and can change during the program.

std::map<> maps an arbitrary key to a value. The only restriction on the key type is that it must support a weak ordering (i.e. you must be able to compare two keys to see if one is less than the other).

In all cases the values must be the same type.
I wonder if the OP means aggregation or composition relationships?

https://stackoverflow.com/help/how-to-ask

Nine words for a question doesn't cut it, IMO.
Topic archived. No new replies allowed.