# Bundling variables

**URL:** <https://community.freefem.org/t/bundling-variables/1319>\
**Category:** General Discussion\
**Created:** [November 11, 2021, 2:29pm UTC](https://community.freefem.org/t/bundling-variables/1319 "2021-11-11T14:29:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![smhosseini12](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/smhosseini12/32/834_2.png) [@smhosseini12](https://community.freefem.org/u/smhosseini12)\
**Post date:** [November 11, 2021, 2:29pm UTC](https://community.freefem.org/t/bundling-variables/1319/1 "2021-11-11T14:29:21Z")

</div>

Hello all,

Is there any way to bundle variables of different types in FreeFem++? Something like struct or class in C++ or MATLAB.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 11, 2021, 2:51pm UTC](https://community.freefem.org/t/bundling-variables/1319/2 "2021-11-11T14:51:02Z")

</div>

You can create your own FreeFEM type which will be a C++ class under the hood. See [FreeFem-sources/addNewType.cpp at develop · FreeFem/FreeFem-sources · GitHub](https://github.com/FreeFem/FreeFem-sources/blob/develop/plugin/seq/addNewType.cpp).

---

<div class="post-metadata">

**Author:** ![smhosseini12](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/smhosseini12/32/834_2.png) [@smhosseini12](https://community.freefem.org/u/smhosseini12)\
**Post date:** [November 11, 2021, 4:11pm UTC](https://community.freefem.org/t/bundling-variables/1319/3 "2021-11-11T16:11:03Z")

</div>

Sorry, I’m new to C++ and FreeFEM, Could you please explain to me how to create a type like the following:

```auto
real Age=20;
string Name="Amir";

mytype.name=Name;
mytype.age=Age;

```

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 11, 2021, 4:27pm UTC](https://community.freefem.org/t/bundling-variables/1319/4 "2021-11-11T16:27:54Z")

</div>

If you don’t know anything about C++, it will be difficult to explain it to you.
