# The strange syntax of \`write(\*,’(A,$)’)\` used in the calculation of the factorial

**URL:** <https://fortran-lang.discourse.group/t/the-strange-syntax-of-write-a-used-in-the-calculation-of-the-factorial/3124>\
**Category:** Uncategorized\
**Created:** [April 4, 2022, 7:29am UTC](https://fortran-lang.discourse.group/t/the-strange-syntax-of-write-a-used-in-the-calculation-of-the-factorial/3124 "2022-04-04T07:29:58Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![Hongyi](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hongyi](https://fortran-lang.discourse.group/u/Hongyi)\
**Post date:** [April 8, 2022, 2:47am UTC](https://fortran-lang.discourse.group/t/the-strange-syntax-of-write-a-used-in-the-calculation-of-the-factorial/3124/21 "2022-04-08T02:47:30Z")

</div>

> [@gak](#):
>
> ```auto
> double complex x(2) 
> data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/ 
> write( 6, '(4A8, "!")' ) x 
> end
> 
> ```

See the following debugging result of the above code snippet:

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/7/7349523a3234f212b2dfc7d3c7eec7283a2fd627.png)

As you can see, the variable `x` has the following initial value:

```auto
Name : x
	Details:((8.5408832230361244e+194,3.9038200537988823e+233), (1.9832370873985416e+272,2.1089767984530232e-52))
	Default:[2]
	Decimal:[2]
	Hex:[2]
	Binary:[2]
	Octal:[2]

```

But finally, the output is as follows:

```auto
abcdefghijklmnopqrstuvwxyz012345!

```

Here, you start by defining two complex numbers that should have four components corresponding to their real and imaginary parts. But finally, you assign it with two strings. Does it make sense?

And I also noticed the following information reported by GDB:

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/0/09fb2db8dd689ba602ce0751565a5418a931e89d.png)

Regards,  
HZ

[Previous page](https://fortran-lang.discourse.group/t/the-strange-syntax-of-write-a-used-in-the-calculation-of-the-factorial/3124.md?page=1)
