Visual C++ 10 小写

编程入门 行业动态 更新时间:2024-10-09 05:14:31
本文介绍了Visual C++ 10 小写 __FILE__ 宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

Visual C++ 10 中的 __FILE__ 预处理器宏扩展为源模块的名称,但使用小写,例如

The __FILE__ preprocessor macro in Visual C++ 10 expands to the name of the source module, but in lowercase, e.g.

c:\path\to\my\file\somesource.cpp

当文件名实际上是

SomeSource.cpp

是否可以改变这种行为?

Is it possible to change this behaviour?

推荐答案

根据 Hans Passant 的建议,我 询问Microsoft Connect 并得到以下答案:

As suggested by Hans Passant, I asked the question on Microsoft Connect and got the following answer:

感谢您注意到这一点.这种行为已经存在一段时间了,至少可以追溯到 VS 2008.更改默认行为可能会对其他客户造成重大变化,所以我们更愿意保持当前的行为.由于 FOO.TXT 与文件系统的 foo.txt 大致相同,希望使用 __FILE__ 进行任何比较都可以涉及对您的应用程序不区分大小写的比较.

Thanks for noting this. This behavior has existed for a while, at least back to VS 2008. Changing the default behavior could potentially be a breaking change for other customers, so we would prefer to keep the current behavior. Since FOO.TXT is mostly the same as foo.txt for the file system, hopefully using __FILE__ with any comparison can just involve a case-insensitive compare for your application.

这篇关于Visual C++ 10 小写 __FILE__ 宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 16:08:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1157100.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Visual

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!