I need to now how to analyse a BMP, the easiest way. This is only a little part of a bigger program and I don't really have a lot of time for this. Basically I only need to now the "coordinates" of the pixels which are black and that of the pixels which are white. I have done some research and found the following sites interesting:
[site I](http://www.experts-exchange.com/Programming/Languages/CPP/Q_20855407.html), [site II](http://www.programuj.com/forum/viewtopic.php?t=6568&sid=8dcb4da79304d64144bbe0413715eb1e)

the second one is in polish but the code posted there is understandable. The first one seems to be much more complicated (and working only on windows, which is ok for me but I try to avoid it), the second one is using vcl.h which is a Borland specific header(I use VisualStudio). I would appreciate, any help, suggestions, or links to sites covering that topic.

PS: This is my first post if you don't like the way I asked the question tell me what to do better. If you want additional information please ask.

Here is the code thanks for your help.

```
// read_and_send_bmp.cpp
#include <iostream><\code>
#include <string>
#include "bitmap_image.hpp"

using std::string;
using std::cin;
using std::cout;
using std::endl;

char * check(string name_of_bitmap);

int main()
{
    string name_of_bitmap;
    cout << "Name of file: ";
    cin >> name_of_bitmap;
    char * toPrint = check(name_of_bitmap);
    cout << endl << "this is the value of 'toPrint': "<< toPrint;
    /* send
    ...
    */
    system("PAUSE");
    return 0;
}

char * check(string name_of_bitmap)
{
    bitmap_image myBitMapImage(name_of_bitmap);
    int size = myBitMapImage.pixel_count();
    char * toReturn = new char[size+1];
        for(int i = 0; i < myBitMapImage.pixel_count(); i++)
        toReturn[i] = 'f';
     int h = 1;
     for(int j = 0, jlen = myBitMapImage.height(); j < jlen; j++)
    {
        for(int i = 0, ilen = myBitMapImage.width(); i < ilen; i++, h++)
            {
            if(myBitMapImage.red_channel(i, j) == 0 && myBitMapImage.green_channel(i, j) == 0 && myBitMapImage.blue_channel(i, j) == 0)
            {
            toReturn[(j)*myBitMapImage.width()+i] = 'b';
            cout << "pixel nr." << (j)*myBitMapImage.width()+i << " = b" << endl;
            }
            else
            {
            toReturn[(j)*myBitMapImage.width()+i] = 'w';
            cout << "pixel nr." << (j)*myBitMapImage.width()+i << " = w" << endl;
            }
        }
    }
    toReturn[size]='\0';
    return toReturn;
}

```