Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Does C# support "const &" or "const ref"?

Mar 27 2003 9:51 PM
When I want to use a large structure as a parameter, I want to pass the const reference. For example, I may want to define a function as public void MyFunc(const ref Hashtable t) { ... ... } In C++ I can use "void MyFunc(const Hashtable& t)". What should use in C#? Or will the compiler recognize this automatically? Thanks a lot