GIDForums  

Go Back   GIDForums > Computer Programming Forums > CPP / C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Nov-2004, 11:19
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,534
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Using map<> with classes


Problem: "Use the type Date [created previously] to develop
a class Event to model events scheduled for specified dates. Use this
class in a program that reads several events and stores these in a
vector (or array) of Events. After all events have been entered, the
output should be in chronological order."

Been working on this for a few days. A suggestion was made that I should consider using the map container to accomplish what I want. My textbook doesn't talk about maps but I found some info on the 'net. However, when I use it I get the following error:
Code:
/home/cody/Projects/enumeration/src/enumeration.cpp:33: no match for ` std::ostream& << const Date&' operator
Am I not using map correctly? (I'm using my new classes instead of fundamental types).

Prior to using the map, I had vector<T> containers for each class and output them seperately; when I changed it to a map is when the errors occurred.

I'm aware that there's a few better ways to have designed my program, but due to time constraints, I'd rather not rewrite it.
Attached Files
File Type: zip src.zip (5.2 KB, 17 views)
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
  #2  
Old 14-Nov-2004, 14:49
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,534
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice
I take it no one uses map containers?
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
  #3  
Old 14-Nov-2004, 16:16
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,234
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by crystalattice
I take it no one uses map containers?
Only when I travel and need to put the map away after looking at it
__________________

Cow: You're a lawyer too?
Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase!
  #4  
Old 14-Nov-2004, 16:23
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,534
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice
Quote:
Originally Posted by WaltP
Only when I travel and need to put the map away after looking at it
Good one. Guess I kinda walked into that.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
 
 

Recent GIDBlogFirst week of IA training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
First time using classes crystalattice CPP / C++ Forum 6 13-Oct-2004 08:21
SDL + Classes Question darkzerox CPP / C++ Forum 2 23-May-2004 19:38
Help with c++ program with classes jimmy55 CPP / C++ Forum 12 18-Mar-2004 10:32
ClassView not showing my classes (VC++, namespace, headers) ?!?!? djovanov CPP / C++ Forum 1 13-Jan-2004 04:54
using windows WMI and CMI classes in Dev-c++ Dawis CPP / C++ Forum 0 26-Oct-2003 04:18

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:39.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.