b91288ec
henyxia
Opening files
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if(argc != 3)
{
printf("bmp2rgb565 [BMP_SRC] [RGB565_DEST]\n");
return 1;
}
FILE* src = NULL;
FILE* dst = NULL;
src = fopen(argv[1], "r");
dst = fopen(argv[2], "w");
if(src == NULL)
{
printf("Unable to open the BMP file\n");
return 2;
}
if(dst == NULL)
{
printf("Unable to open the RGB565 file\n");
return 3;
}
return 0;
}
|