---
# System prepended metadata

title: 建構式

---

# 建構式
```
#include <iostream>
using namespace std;
class data
{
  public:
    data(int in): a(in)
    {
    };
    show()
    {
        cout << a << endl;;
    }
  private:
    int a;
};
int main()
{
    data d1(5);
    d1.show();
}
```