# Delaration of an array with indexed type

**URL:** https://discourse.julialang.org/t/delaration-of-an-array-with-indexed-type/20399
**Category:** Internals & Design
**Created:** [February 3, 2019, 1:38pm UTC](https://discourse.julialang.org/t/delaration-of-an-array-with-indexed-type/20399 "2019-02-03T13:38:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Regaieg\_Rym](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@Regaieg\_Rym](https://discourse.julialang.org/u/Regaieg_Rym)
#### Post date: [February 3, 2019, 1:38pm UTC](https://discourse.julialang.org/t/delaration-of-an-array-with-indexed-type/20399/1 "2019-02-03T13:38:24Z")

</div>

Hi,

I found a big problem to declare an array with composite type.

In my code, I would like to write

tuple PM  
{  
npm::Int64  
nvm::String;  
}

indexes=PM  
push!(indexes,PM(1,“s”))  
push!(indexes,PM(2,“s”))  
push!(indexes,PM(1,“m”))  
push!(indexes,PM(2,“m”))

How could I write ths declaration ?

int countPVX[indexes]; ???

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [February 3, 2019, 1:54pm UTC](https://discourse.julialang.org/t/delaration-of-an-array-with-indexed-type/20399/2 "2019-02-03T13:54:10Z")

</div>

> [@Regaieg\_Rym](#):
>
> tuple PM  
> {  
> npm::Int64  
> nvm::String;  
> }

This is not even Julia code?

> [@Regaieg\_Rym](#):
>
> int countPVX[indexes]; ???

Neither is this.

Please try to put some effort into formulating your question. See [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757).

---

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [February 3, 2019, 3:50pm UTC](https://discourse.julialang.org/t/delaration-of-an-array-with-indexed-type/20399/3 "2019-02-03T15:50:07Z")

</div>

xref: [indexing - Problem how to declare an array of composite type with Julia - Stack Overflow](https://stackoverflow.com/questions/54503339/problem-how-to-declare-an-array-of-composite-type-with-julia)
