# C++, create variable with specific name

**URL:** <https://swi-prolog.discourse.group/t/c-create-variable-with-specific-name/4196>\
**Category:** General\
**Created:** [July 24, 2021, 12:39pm UTC](https://swi-prolog.discourse.group/t/c-create-variable-with-specific-name/4196 "2021-07-24T12:39:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [July 24, 2021, 12:39pm UTC](https://swi-prolog.discourse.group/t/c-create-variable-with-specific-name/4196/1 "2021-07-24T12:39:30Z")

</div>

Dear experts,

Let’s say I create a new variable in the c++ interface:

PlTerm t ;

When I print this variable, e.g. by

cout \<\< (char\*) t \<\< endl ;

It’s name is something like \_1620. Can I give it a different name? I need it for pretty printing only, so, in principle, I can unify it with some atom ‘X’ and all good, but maybe there is something more elegant.

Best wishes

Matthias

---

<div class="post-metadata">

**Author:** ![mgondan1](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/mgondan1/32/803_2.png) [@mgondan1](https://swi-prolog.discourse.group/u/mgondan1)\
**Post date:** [July 25, 2021, 9:34am UTC](https://swi-prolog.discourse.group/t/c-create-variable-with-specific-name/4196/2 "2021-07-25T09:34:00Z")

</div>

Ups. I see that the pretty names aren’t visible inside prolog, just from write\_term. Ok, case closed.
