Readonly and other things about C++
2015-04-13 22:52
453 查看
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 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#.
相关文章推荐
- usage of fscanf and other read functions in C/C++
- Something about file's read and write (C++)
- A log about Reading the memroy of Other Process in C++/WIN API--ReadProcessMemory()
- How to Enable Read-Only Client Drive Mapping and Clipboard Mapping for XenApp
- Dropping and creating tables in read only tablespaces?!
- C++: read access data using ADOX.DLL and System::Data::OleDb
- sysbench write and read only
- Just4Fun - Comparaison between const and readonly in C#
- C++编译错误"a storage class can only be specified for objects and functions"解决
- const, static and readonly
- Some things about the ASCII,Unicode and UTF-8
- The difference of static, readonly and const in C#
- The difference between Const and ReadOnly
- CRUD for user and other things to do...
- Data Structures and Other Objects Using C++ (Chapter 2) 学习笔记四
- What Every Computer Programmer Should Know About Windows API, CRT, and the Standard C++ Library
- VirtualStream, SeekableReadonlyStream and MarkableForwardOnlyEventingReadStream
- oracle concurrency -- serializable and read only
- A question about C++ static method and C# static method
- [Note]CLR via C#3-Readonly and Const