在第13行读取完"Hello, world!"后,文件指针已经移动到了文件末尾,但是并没有读取到文件末尾的标记,因此eof()返回的仍然是false。只有当再次尝试读取文件时才会返回true。

我有以下dlang语言代码import stdstdio;void main auto file = Fileexampletxt w; filewritelnHello world!; fileclose; auto file2 = Fileexampletxt r; writelnfile2name; 输出 exampletxt writelnfile2e

原文地址: https://www.cveoy.top/t/topic/gKzh 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录