This can be achieved using the C standard library functions fopen(), fread(), fclose() and printf(). The specific code is as follows: #include<stdio.h> int main() { FILE *fp; int size; unsigned char * image;
// 读取图片
fp = fopen("sample.jpg", "rb");
if(fp == NULL)
{
printf("File not found\n");
return -1;
}
//