Need to use the data from array, but prevent it from writing.
Can't use const.
Find the contradiction in your request ;-)
Really, you should be using const here. Otherwise, the best you could do is passing a copy of the original data. This won't prevent modifications, but only the copy, not the "original", would be modified.
a determined idiot can mess with most containers, but if your coders are not intentionally being determined idiots, the above is fine. Pointer shuffling can get past a lot of protections, and classically lets you modify or print private class members or constants etc that you were locked out of touching. Here, I simply clean the raw pointer address by passing it through an integer.
If your peers are doing stuff like this without cause* they need to be disciplined and possibly relieved of their duties depending on what they were doing.
** this can be legit in extreme circumstances like a 3rd party library that hides something you require.
it may also be worth noting that buffer overflows can touch other memory and read or modify it. Usually by accident, eg off by one in an array processing loop changes the integer stored after the array...
Im 100% sure nothing amends the original contents, it's magic number or stackoverflow...
Are we dealing with an X-Y problem here? Are you really saying "something is changing my array and I want it to stop?" That's a completely different issue and means that you need to debug your code.