www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/16/12:18:48

From: "Chris" <anthropomorphic1 AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: wont compile in DJGPP
Date: Sun, 16 Sep 2001 12:05:18 -0400
Lines: 46
Message-ID: <9o2ij8$ak3ka$1@ID-72226.news.dfncis.de>
NNTP-Posting-Host: pool-151-197-190-184.phil.east.verizon.net (151.197.190.184)
X-Trace: fu-berlin.de 1000656297 11144842 151.197.190.184 (16 [72226])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2462.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

can i have some help i cant seem to get this to compile in
DJGPP

#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;
   }

--


------------------------------------
Make Unlimited phone calls from your PC to ANY phone in the World!
http://www.eboom.com/free/


- Raw text -


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