# Problem in attaching array type in struct

**URL:** <https://discourse.julialang.org/t/problem-in-attaching-array-type-in-struct/36417>\
**Category:** New to Julia\
**Created:** [March 24, 2020, 5:40am UTC](https://discourse.julialang.org/t/problem-in-attaching-array-type-in-struct/36417 "2020-03-24T05:40:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [March 24, 2020, 5:46am UTC](https://discourse.julialang.org/t/problem-in-attaching-array-type-in-struct/36417/2 "2020-03-24T05:46:01Z")

</div>

First, [please surround your code with triple backticks](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757).

Second, you cannot have variable assignments within a struct. The error message you get tells you this:  
`ERROR: syntax: "it = zeros(Int8, 10)" inside type definition is reserved`

If you need this data inside a struct, create a field `it::Vector{Int8}` and then initialize the struct with `lis(zeros(Int8, 10), ...)`.

---

_[View the full topic](https://discourse.julialang.org/t/problem-in-attaching-array-type-in-struct/36417)._
