QUOTE(illello @ 20 Mar, 2007 - 01:29 AM)

I see that you are missing variables declariation, incorrect use of some function, incorrect use of variable name declared and so on. You have just easy compile error, start correcting them.
hey i actually fixed all that too but it is still giving me errorsfor setw i dont understand wut to do with it or probably look at the following i made this code it works fine but i dont know wut i did tht instead of giving me my desired output its giving me the location of my assignment
CODE
#include <iostream>
#include <fstream>
#include <map>
#include <algorithm>
using namespace std;
struct print_it
{
void operator() ( const pair<char,int>& p ) const
{
cout << p.first << " occurs " << p.second << " times\n";
}
};
int main( int argc, char** argv )
{
if( argc != 2 )
{
cout << "usage: " << argv[0] << "file_name\n";
return 1;
}
ifstream myinput( argv[1] );
if( !myinput)
{
cout << "could not open file " << argv[1] << '\n';
return 2;
}
map<char,int> char_count;
char c;
while( myinput >> c ) ++char_count[c];
for_each( char_count.begin(), char_count.end(), print_it() );
return 0;
}