Suppose I have a program like this:Where the takeaway is that I'm trying pass the main() function's char** argument to another function or class. (I understand there are better ways to achieve what the above program does, my question is about passing char** arguments as read-only).
The program still prints a word copying which indicates that the copy constructor is activated. Where is the constructor called then ? Why the function does not return a reference of o1 so that modifying the value of res will also changing the value of o1 ?
I encountered an interesting case where pass-by-reference does not appear to work in VB.NET. I've supplied some sample code below for you all to play with. Can anyone explain this phenomenon. Is this intended, or a bug with the language/compiler?
the above code will give no error/warnings. But why is the same not applicable for the below mentioned code?