带点的Const变量 [英] Const variable with dot

查看:86
本文介绍了带点的Const变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,



我想问...



我遇到了这段代码我试着跑......他们说已经有了......但是我遇到了一个错误..



Hi Good Day,

I would like to ask..

I met this code and I tried to run... they say it is already working.. but I encountered an error..

const string my.var  = " "; 





我在Visual Studio中遇到错误,但我的同事告诉我它正在运行..我只是想不出来...



请帮忙。谢谢。



我尝试过:



已经研究过const变量名带点..但找不到任何..



+++

使用VS 2013 Express时没有错误,错误在VS 2012或2015上。



I encountered an error in Visual Studio, but my colleagues told me that it is working.. I just can't figure it out...

Please help. Thanks.

What I have tried:

Already researched about const variable name with dot.. but can't find any..

+++
No error when using VS 2013 Express, Errors on VS 2012, or 2015.

推荐答案

Dot不是符号中的有效字符(例如变量名称)。它代表会员运营商。所以 my.var 读作对象/结构的成员 var 无论我的
"Dot" is not a valid character in a symbol (such as a variable name). It represents the membership operator. So my.var reads as "the member var of object/struct/whatever my ".


这篇关于带点的Const变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆