I have a raw-12 image file . I want to read this using c++ into 2-d array . but i don't understand the the basic picture of raw-12 file that how pixels are really arranged in it. can anyone help ?
The term Raw-12 generally means 12-bits per pixel element and raw is the pixel sensor value.
On top of this if you're dealing with a color sensor, each element is only 1-color, with the color pattern distribution or mosaic dependent upon the device or camera. Typically a "Bayer" pattern is used, but not always, and the color phase varies.
Commercial cameras generally also compress the raw data and insert metadata.
As far as I know, the exact pixel layout definition is not part of a standard but you may be able to extract it from the meta data.
I assume this is a programming assignment for you, because there are already entire suites of software to handle this for commercial cameras.