本文介绍了在托管C ++逐字字面? (如C#的@"等等")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在托管C ++使用逐字字符串?类似于C#的
字符串文档= @C:\ Documents和Settings \
解决方案
在C ++ 11,有原始的字符串:
COUT<< R((\DDD \ AA)\ n)的<< ENDL;
COUT<< R分隔符((\DDD \ AA)\ n)的分隔符<< ENDL;
输出为:
(\DDD \ AA)\ñ
(\DDD \ AA)\ñ
Is there a way to use verbatim String literals in managed C++? Similar to C#'s
String Docs = @"c:\documents and settings\"
解决方案
in C++11, there is raw string literal:
cout<<R"((\"ddd\aa)\n)"<<endl;
cout<<R"delimiter((\"ddd\aa)\n)delimiter"<<endl;
output is:
(\"ddd\aa)\n
(\"ddd\aa)\n
这篇关于在托管C ++逐字字面? (如C#的@&QUOT;等等&QUOT;)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!