Skip to content

Instantly share code, notes, and snippets.

@milk19873
Last active October 30, 2016 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milk19873/ff95439ba559ec0a951387961d1f6f43 to your computer and use it in GitHub Desktop.
Save milk19873/ff95439ba559ec0a951387961d1f6f43 to your computer and use it in GitHub Desktop.
第9回プログラミング講座(ヒープ領域)
namespace SimpleCalc
{
public class Calc
{
//このクラスで使用する変数を宣言する。
public int suji1 = 0;
public int suji2 = 0;
}
public partial class Form1 : Form
{
//インスタンス生成
Calc CalcA = new Calc();
Calc CalcB = new Calc();
//「.」を使うことでクラスの内部の変数にアクセス出来る
CalcA.suji1 = 5;
CalcB.suji1 = 10;
//CalcBをCalcAに代入
CalcA = CalcB;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment