Can anyone tell me the difference between ASCII E开发者_如何学Cnglish Text and ASCII C Program Text files. I have been writing a small program and when I use the Linux 'file' command on one of the files it describes it as ASCII English Text whereas all other files are described as ASCII C Program Text. The program compiles but I am getting strange results. This might be unrelated but I cant escape the thought that this is causing the issue.
So what are the difference between these files? Why does the file compile and could this cause issues? Finally how can I convert from ASCII English Text to ASCII C Program Text.
Thanks!
There is no 'magic number' in C source code files, so the file
utility can only use some heuristics (like 'if it contains "#include <" in the first few lines) to guess it is a 'C' file. If the file doesn't match any of the heuristics, but contains some English words, then the file
utility may guess wrong. Nothing to worry about. The C code is supposed to compile and run well, it is not written just to be identified by file
.
精彩评论