SunQuest
           C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old June 21st, 2002, 09:31 AM
sraj@biztelone sraj@biztelone is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 0 sraj@biztelone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hashtable within another hashtable.

Hi,

I hope someone can help me with the following prob..

I need to implement a hashtable whose KEYs are strings and VLAUEs are
again hashtables.
ie key - is a string and value -is another hashtable .

I used Rogwave library class RWTValHashDictionary for iplementing the
hashtable.Singe level hashtable is working fine.(ie where there is no
nesting..)

But when i am trying to put a hashtable as the value for the outer
hashtable, i am getting the following errors..

$ CC -compat -o xsttest -library=rwtools7,iostream
-I/opt/SUNWspro/WS6U2/include
/ -L/opt/SUNWspro/lib/ testHash.cpp
"/opt/SUNWspro/prod/include/CC/rw7/rw/tasslnk.cc", line 59: Error:
Could not fin
d RWTValHashDictionary<RWCString, RWDate>::RWTValHashDictionary() to
initialize
value_.
"/opt/SUNWspro/prod/include/CC/rw7/rw/tvsldict.cc", line 68:
Where: While in
stantiating "RWTValAssocLink<RWCString,
RWTValHashDictionary<RWCString, RWDate>>
::RWTValAssocLink(const RWCString&)".
"/opt/SUNWspro/prod/include/CC/rw7/rw/tvsldict.cc", line 68:
Where: Instanti
ated from RWTValSlistDictionary<RWCString,
RWTValHashDictionary<RWCString, RWDat
e>>:perator[](const RWCString&).
"/opt/SUNWspro/prod/include/CC/rw7/rw/xvhdict.cc", line 148:
Where: Instanti
ated from RWTValHashDictionary<RWCString,
RWTValHashDictionary<RWCString, RWDate
>>:perator[](const RWCString&).
"/opt/SUNWspro/prod/include/CC/rw7/rw/xvhdict.h", line 186: Where:
Instantia
ted from non-template code.
1 Error(s) detected.





The program testHash.cpp is as below....

#include <rw/tvhdict.h>
#include <rw/cstring.h>
#include <rw/rwdate.h>
#include <rw/rstream.h>

main() {
RWTValHashDictionary<RWCString,RWTValHashDictionary<RWCString,RWDate>
> clecHa
sh(RWCString::hash);

RWTValHashDictionary<RWCString,RWDate> preorderHash(RWCString::hash);
preorderHash.insertKeyAndValue("sreeraj", RWDate(2, "Nov", 1980));
preorderHash.insertKeyAndValue("sraj", RWDate(6, "Nov", 1986));

RWTValHashDictionary<RWCString,RWDate>
preorderHash1(RWCString::hash);
preorderHash1.insertKeyAndValue("sreeraj", RWDate(2, "Nov", 1987));
preorderHash1.insertKeyAndValue("sraj", RWDate(6, "Nov", 1989));

clecHash.insertKeyAndValue("APIT",preorderHash);
clecHash.insertKeyAndValue("ICC",preorderHash1);

RWTValHashDictionary<RWCString,RWDate> pre_hash(RWCString::hash); //
from the m
ain Hash !
RWBoolean fl =clecHash.findValue("ICC",pre_hash);
if(fl)
{
RWDate bday;
RWBoolean fl1 = pre_hash.findValue("sraj",bday);
if(fl1)
cout<<bday;
}

return 0;
}



Hope someone can help with some suggestions..

Thanks in advance
sreeraj

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > hashtable within another hashtable.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway