endianize.cc File Reference

#include <vector>
#include <iterator>
#include <iostream>
#include <algorithm>

Go to the source code of this file.

Functions

 main ()


Function Documentation

main ( void   ) 

Definition at line 8 of file endianize.cc.

00008       {
00009 
00010   ostream_iterator<char> lOut(cout);
00011 
00012   cerr << "This takes characters from stdin,"
00013        << endl
00014        << "reshuffles them in order to"
00015        << endl
00016        << "change 'endianicity' and gives them to"
00017        << endl
00018        << "stdout"
00019        << endl;
00020 
00021   while(cin){
00022     char gBuffer[4];
00023     cin.read(gBuffer,4);
00024     if(cin){
00025       reverse(gBuffer,gBuffer+4);
00026       copy(gBuffer,
00027      gBuffer+4,
00028      lOut);
00029     }
00030   }
00031 }


Generated on Wed Jan 7 00:30:51 2009 for Gift by  doxygen 1.5.6