tags:

views:

72

answers:

1

In C++ it's recommended to have const-correctness everywhere. But since in .Net world, the string content cannot be changed, (new string will be created), do I still write String^ const?

A: 

No. Just pass a handle to a string directly: method(String^ string)

Reed Copsey
ok, what if in a method, I want to define a const string, would it be better that I put const there so anyone else would know it's a not-changed string?
AZ