//include file from a large library that gives us the ability to program in
//C++
#include <stdio.h>
#include <stdlib.h>
//
int main()
{
File * fPointer;
//fpointer gives direction to which file needs to be opened this case mytxt
fPointer = fopen("mytext.txt","r");
char singleLine[150];
//feof = file end of file
//means keep looping till end
while(!feof(fPointer)) {
//going to go line by line
//
fgets(singleLine, 150, fPointer);
}
//close the pointer or the use of this function
fclose(fPointer);
return(0);
}
我在某处看到一个程序,我对其进行了一些修改以满足我的需要,我的目标是将其转换为 .exe,然后让它显示文件 mytext.txt 中的内容(它是 5 行内容)。已经为此工作了几个小时,但仍然没有发现问题。请帮助我,我很擅长这个。
[我使用 mobaxterm 和 unix linux shell(我相信是 bash 文件)]
谢谢您,在新冠疫情期间保持安全