The usual workaround in Java/Scala that should seem somewhat familiar to the C/C++ programmers is the following:
val x = Array[Int](41)
val rx = x
rx(0) += 1
println(x(0))
You cannot have references or pointers to primitive integer variables, but arrays kind of contain information equivalent to a pointer, so if you declare x to be an Array[Int] with a single element instead of an Int, you get roughly the same behavior: the above example will print 42.
You can think of it like this:
Array[X] roughly corresponds to X[] in C, which in turn roughly corresponds to X*
x(0) corresponds to accessing the value at the "pointer" x, so it's something like *x in C.
The crucial difference is that you can only declare an array right from the beginning. There is no way to get a "pointer" to an arbitrary location in memory.
Note however that the array will reside on the heap (usually, unless it is eliminated by some escape-analysis), you cannot keep it in the stack frame of a function.