228k views
4 votes
Write the header for a function addOne that accepts a single integer reference parameter and returns nothing. Name the parameter x.

1 Answer

4 votes
In C++ it would be: void addOne(int& x);

In C# it would be: void addOne( ref int x)

In JAVA you would have to package the integer inside an object, since it doesn't pass value types by reference.
User GodsCrimeScene
by
8.4k points