cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Map with structs
Map with structs
Nov 6, 2012 at 6:40am UTC
vrakas
(53)
Can i make a make out of a struct i will make(for key AND for value) g struct cup{int capacity,price};
and then map<cup,cup> m1; i should write a comparison function also, but how? Thanks
Nov 6, 2012 at 6:43am UTC
Zhuge
(4664)
Certainly, but as you so you'll need to write a comparison function. Check out this page's section on operator overloading:
http://cplusplus.com/doc/tutorial/classes2/
Nov 12, 2012 at 7:30pm UTC
vrakas
(53)
thanks a lot
Topic archived. No new replies allowed.