All right thanks. Thats settled.. IM getting the cumulative values for cdf[] now..

My second and probably the last issue is how do i display the NEW intensity values on the old image, after this code:

unsigned int arrayhe[256];
for (i=0; i<256; i++) // applying the HE algorithm
arrayhe[i] = (cdf[i]*255/262144)+0.5;
Do help me out on this thanks.