ポインターをパラメーターとして使用し、ポインターの 1 つを返す関数を実行したいのですが、可能ですか?
例:
int* sum(int* x, int* y, int* total){
total=x+y;
return total;
}
次のエラーが表示されます。
main.cpp:10:13: error: invalid operands of types 'int*' and 'int*' to binary 'operator+'
参照ではなくポインターのみを使用してそれを行うにはどうすればよいですか?