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:
  #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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT