Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一种方法来打开文本文件并找到某个字符串,然后获取它所在的行,然后获取该行的内容。我找不到任何帮助。此外,我需要使用 C++ 和预安装的库...等任何无法在 Mac 上运行或未预装 C++ 的东西...。我也许可以使用其他小的库...
open a filestream while filestream is NOT at End Of File get a line of the file into a temp string search the temp string for the keyword if the keyword is in it thats your line, exit the loop else keep looping
希望这对你来说是一个足够大的提示。