Skip to content

Instantly share code, notes, and snippets.

@milk19873 milk19873/program.cs
Last active Oct 30, 2016

Embed
What would you like to do?
第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
You can’t perform that action at this time.