Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
関数を呼び出すためにパラメーターとして渡す呼び出し関数で変数の値を維持するにはどうすればよいですか?
ref キーワードを使用すると、変数が永続化されます。
private void method() { int a = 10; function(ref a); } private void function(ref int a) { //do work and change value of a }