www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/19/02:05:06

Date: Wed, 19 Sep 2001 08:43:35 +0300 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
X-Sender: pavenis AT ieva06
To: Chris <anthropomorphic1 AT hotmail DOT com>
Cc: djgpp AT delorie DOT com
Subject: Re: DJGPP archive:
In-Reply-To: <9o8roi$bni63$1@ID-107925.news.dfncis.de>
Message-ID: <Pine.A41.4.05.10109190840580.27036-100000@ieva06>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On Tue, 18 Sep 2001, Chris wrote:

> Where can we find the latest version of DJGPP
> with the C++ std.  I cant seem to get this to compile
> with 2.95
> 
> #include <iostream>
> #include <algorithm>
> #include <vector>
> #include <fstream>
> #include <cstdlib>
> #include <limits>
> 
> int  main()
>    {
>    std::ifstream in("dic.txt");
>    std::vector<std::size_t> cs(std::numeric_limits<unsigned char>::max());
>    std::istreambuf_iterator<char> it(in);
>    std::istreambuf_iterator<char> end;
>    while(it != end)
>       {
>       unsigned char ch=(unsigned char)*it++;
>       ++cs[ch];
>       }
>    in.close();
>    unsigned char pos='\0';
>    std::size_t icount = 0;
>    while(pos != cs.size())
>       {
>       if (cs[pos] > 0)
>       {
>          std::cout<<(char)pos<<": "<<cs[pos]<<", ";
>          if(++icount%5==0)
>             std::cout<<'\n';
>       }
>       ++pos;
>       }
>    std::cout<<"Goodbye"<<std::endl;
> 

Code uses features not supported in libstdc++ from gcc-2.95.X. 
Use either STLPort (untested) or try upgrading to gcc-3.0.1:
	http://www.ltn.lv/~pavenis/gcctest.html
(not uploaded to simtelnet yet)

Andris


  

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019