Unicode版本的getline函数 [英] Unicode version of getline function
问题描述
Hello Programmers,
我正在将我的ascii C ++项目转换为unicode。我正面临着 getline 功能的麻烦。
查看下面粘贴的代码。
Hello Programmers,
I am converting my ascii C++ project to unicode.I am facing troubles with getline function.
Have a look on the code pasted below.
// Ascii code:
string OutputString;
ifstream IniFile ("D:\\FileName.INI");
while ( /*some condition*/ )
{
getline(IniFile, OutputString);
}
// After conversion in unicode:
twstring OutputString;
ifstream IniFile (_T("D:\\FileName.INI"));
while ( /*some condition*/ )
{
getline(IniFile, OutputString);
}
当我尝试构建unicode时,最终会出现以下错误。
错误:没有重载函数的实例getline匹配参数
我理解getline不接受twstring类型的参数。基于此我有以下问题。
问题:
- 我们有getic函数的unicode版本吗?
- 如果不是如何处理这些情况?
请帮忙。
问候,
Joy
When I try to build in unicode, it ends up with below error.
error: no instance of overloaded function "getline" matches the argument"
I understand that getline does not accept argument of twstring type. Based on that i have below questions.
Questions:
- Do we have unicode version of getline function?
- If not how to handle these situations?
Please help.
Regards,
Joy
推荐答案
请参阅: http://forums.codeguru.com/showthread.php?511066-RESOLVED-Is-it-possible-to-use-getline-with-unicode 一> [ ^ ]。
-SA
这篇关于Unicode版本的getline函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!