文件 C++ 中的字符串BorlandC 3.1

发布于 2024-10-01 14:49:54 字数 248 浏览 0 评论 0原文

我试图将文件的内容放入变量中,但 BorlandC 3.1 遇到问题。 我已阅读 http://cplusplus.com/doc/tutorial/files/< 上的文档/a> 但是,我在 Borland 中没有 getline...

任何人都可以向我指出一种将文件第一行中的字符串获取到变量中的方法吗?谢谢。

I'm trying to put the content of a file into a variable, but I'm having issues with BorlandC 3.1 .
I've read the documentation for this on http://cplusplus.com/doc/tutorial/files/ but, I don't have getline in Borland...

Can anyone point me to a way to get the string from the first line of the file into a variable ? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酷到爆炸 2024-10-08 14:49:54

有多个 getline。自 BC++ 起使用 one 3.1 没有附带 提供的版本(因为如果我没记错的话,它比 STL 早很多年)。

There is more than one getline. Use the <iostream> one since BC++ 3.1 does not come with the one provided by <string> (because it precedes STL by quite a few years if I remember correctly).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文