C ++ / CLI等同于C#的'readonly'关键字 [英] C++/CLI equivalent of C#'s 'readonly' keyword

查看:218
本文介绍了C ++ / CLI等同于C#的'readonly'关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#/ CLI等效于C#的 readonly 关键字?

What's the C++/CLI equivalent of C#'s readonly keyword?

具体来说,或C ++ / CLI类的受保护成员,以便在从C#引用时只读

Specifically, how do you write a public or protected member of a C++/CLI class such that it is readonly when referenced from C#?

推荐答案

我刚刚发现(感谢文字栏位对于C ++ / CLI中的常量变量


  • C# const 是C ++ / CLI中的 literal

  • C# readonly c $ c> initonly 在C ++ / CLI中

  • C# const is literal in C++/CLI, and
  • C# readonly is initonly in C++/CLI

这篇关于C ++ / CLI等同于C#的'readonly'关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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