Code:
if((stream = fopen(argv[1],"rb" ))!= NULL )
    {
      numread = fread(buf,sizeof(int),size,stream );
      fclose( stream );       
      printf( "Number of items read = %d\n", numread );
 	    for (k = 0; k < size; k++)
	      {
               printf(FORMAT,buf[k]);
	      }
	}
Where size = 240000 and FORMAT is int.
And infact i should read 4 bytes and the 4th byte being a zero ......So i have used as it is.
Now the buf contains 80000 pixels. Its just a part of the read,
So now can u figure it out?

Last edited by shabbir; 13Dec2007 at 20:50.. Reason: Code block