码迷,mamicode.com
首页 > 编程语言 > 详细

Readonly and other things about C++

时间:2015-04-14 00:33:59      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

1. in c#

readonly can be delayed to initialize in constructor.

 

2. in c++

totally no readonly.

 

Many people have mastered c++ before c#. They are the managers.

So many of the interview are about the difference of c# and c++.

I am always confused about the interview problems since I never use it before.

Such as readonly. In c#, there are no pointer, we don‘t need const and readonly actually.

All you need to do is set a All caps up variable name as a field. such as:

class A 

{

double MYPI=0.7;

}

I am sure none will try to change it in the methods. The same for static. Only one way I will use static:

when I need to use a static method. That is all. Please forget the differece of static readonly and const.

We don‘t need it totally.

 

When I interviewed with Microsoft one year ago.

I am aware of that, the most important things of c# are all in Effective C#.

If you understand all items, you understand how to use c#.

  

 

Readonly and other things about C++

标签:

原文地址:http://www.cnblogs.com/gaoxianzhi/p/4423580.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!