Edit2: I also placed return arr[777]+barr[777]+vec[777]; at the end - otherwise the compile would optimize the entire main function away (minus output), as the arrays aren't used.
I believe VC++ enables (or used to enable) iterator checking by default, even in release mode. Google something along the lines of "vc++ disable secure scl" to turn it off. This should vastly improve the vector performance.
And yes, C# can easily come close to C++ performance in some cases (or even exceed it). But it varies a lot.
something i got on internet about c# & c++
"
Except for writing time-critical blocks of code, prefer C#. Write all your algorithmic code in C++ (not VC++ .NET), compile it into a dll and call that using a Dll Interop through C#. This should balance the performance. This technique is not new or not invented by me or anyone. It's similar the old age C programming vs Assembly, where people on one camp fight assembly programming is faster and the other camp stating C is easier to develop and then people started using assembly embedded within a C program for time-critical applications using an asm block.