🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++.leda
Article #12

need help: on using g++ String with LEDA 3.1.2

#12
From: Ashvin Kannan
Date: Tue, 01 Aug 1995 14:46
41 lines
1429 bytes
Hi all,

  I'm having problems using the g++ "String" class (from 2.6.3) with LEDA
3.1.2. In using LEDA's "dictionary" class I get an error message that
"compare" is not defined, but in looking at g++'s String.h, I can see it. 
It's probably something obvious, I'm missing out on. 

  Please help! Thanks.

  Ashvin

Error messages:
----------------------------------------------------------------------
ERROR compare undefined
IOT trap
----------------------------------------------------------------------

Code:
----------------------------------------------------------------------
#include <String.h>
#include <LEDA/dictionary.h>

int main()
{
    dictionary<String, int> D;
    dic_item it;
    String s;

    while (cin >> s)
    {
	it = D.lookup(s);
	if (it == nil)
	    D.insert(s,1);
	else
	    D.change_inf(it, D.inf(it)+1);
    }	
    forall_items(it,D)
	cout << D.key(it) << ":" << D.inf(i)t << endl;
    return 0;
}
----------------------------------------------------------------------
Technical Details
Message-ID: <ASHVIN.95Aug1104611@parrot.bu.edu>
Path: arc1-ca.pugleaf.net!news.bu.edu!ashvin

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.bu.edu!ashvin
From: ashvin@raven.bu.edu (Ashvin Kannan)
Newsgroups: comp.lang.c++.leda
Subject: need help: on using g++ String with LEDA 3.1.2
Followup-To: comp.lang.c++.leda
Date: 01 Aug 1995 14:46:11 GMT
Organization: Boston University
Distribution: world
Message-ID: <ASHVIN.95Aug1104611@parrot.bu.edu>
Reply-To: ashvin@bu.edu
NNTP-Posting-Host: parrot.bu.edu