# Using C struct referenced by address in clarion

**URL:** <https://clarionhub.com/t/using-c-struct-referenced-by-address-in-clarion/863>\
**Category:** Interop\
**Created:** [November 21, 2016, 1:38am UTC](https://clarionhub.com/t/using-c-struct-referenced-by-address-in-clarion/863 "2016-11-21T01:38:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanh](https://clarionhub.com/letter_avatar_proxy/v4/letter/s/4af34b/32.png) [@seanh](https://clarionhub.com/u/seanh)\
**Post date:** [November 21, 2016, 1:38am UTC](https://clarionhub.com/t/using-c-struct-referenced-by-address-in-clarion/863/1 "2016-11-21T01:38:28Z")

</div>

Hi All  
I’m trying to interact with a C dll.  
The C has a struct that it creates in one function and returns a pointer to it.  
How do you reference the structure in clarion?

```auto
struct theStruct
int fieldA
int fieldB;

   code
   struct theStruct *my_structl;
    my_struct = Z_Create();

```

How do I reference and use fieldA and fieldB ??

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [November 22, 2016, 3:52am UTC](https://clarionhub.com/t/using-c-struct-referenced-by-address-in-clarion/863/2 "2016-11-22T03:52:48Z")

</div>

```
TheStructType Group,TYPE
fieldA long
fieldB long
    END

TheStruct &TheStructType
  CODE
 TheStruct &= 0 + Z_Create()

 message('FieldA[' & TheStruct.FieldA & ']')

```

---

<div class="post-metadata">

**Author:** ![seanh](https://clarionhub.com/letter_avatar_proxy/v4/letter/s/4af34b/32.png) [@seanh](https://clarionhub.com/u/seanh)\
**Post date:** [November 22, 2016, 4:46am UTC](https://clarionhub.com/t/using-c-struct-referenced-by-address-in-clarion/863/3 "2016-11-22T04:46:29Z")

</div>

Thanks Mark.

Between this and the replies on the newsgroups I’ve managed to get this going.

It’s for a Barcode library and I’m impressed that I got it to go 🙂
