I want to read a text file using the C Language.Here file: -

You see that there is a template in the text content of the file. 0 means nothing. 9 means black. therefore there is a coloring scheme from 0 to 9.
I need to create a bitmap of this, and the color matches the values ββin the template. You must configure it using the 0-256 color scheme. And the final conclusion for this is shown below.

Now see that the template in the contents of the text file matches the final output raster file (optional). The darkness of the colors in the bitmap corresponds to the values ββin the text content template.
Someone tell me how I do it in C.
I can create a BMP file, but not according to the pattern in the text file.
#include <stdio.h>
source share