To do a work i want to identify the type of file. But the files are without extension.The files may be txt,jpeg,mp3,pdf etc. Using c or c++ or python how can i check whether it is a jpeg or pdf or mp3 file?
Some files, such as .exe, .jpg, .mp3, contain a header (first few bytes of the file).  You can inspect the header and infer the file type from that.  
Of course, some files, such as raw text, depending on their encoding, may have no header at all.
how to identify the type of files having no extension?