-2

我无法使用 ifstream() 从我的文本文件 (UTF8) 中读取 Unicode 符号,但有些奇怪。你能帮我提供使用方法以及函数中使用哪些参数ifstream吗?

4

1 回答 1

0

您可以为此使用 std 命名空间字符串和 ifstream 。

ifstream in("1.txt");
string s;
while(getline(in,s)
{
  for(int i = 0; i<s.length; i++){
     cout << s[i] ;
  }

}
in.close();
于 2013-01-19T09:50:08.387 回答