سؤال

Are there all types of files that can be opened with notepad like .txt, .c or .java the same ones that can be opened with fopen() or is there any exception?

هل كانت مفيدة؟

المحلول

The short answer is that C does not care about file types and therefore your assumption is true.

The long answer is that the short answer only applies to regular files (all of the ones listed by you are regular files), in some cases it does not apply to special files like device files, FIFOs. On Windows, you might have an issue with links (.lnk files), depending on your C library. The C library might not follow those links whereas Notepad will.

That does however not mean that the file in question will be displayed correctly. Encoding and/or linebreaks might be an issue.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top