How to find file type(format) without extension file using c ...
stackoverflow.com › questions › 37046090May 05, 2016 · /* This program used to find the file format for without extention file */ #include <stdio.h> #include <error.h> #include <errno.h> int main(int argc, char *argv[]) { FILE *fp; struct image image_bmp; if (argc != 2) { perror("Error in commandline argument "); exit(1); } fp = fopen(argv[1], "r"); if (fp == NULL) error(1, errno, "Error in file open "); /* i am try to display argv[1] file format for without extention file Ex: argv[1] is a txt file argv[2] is a image file */ fclose(fp); error ...