# Simplify accessing struct field values

**URL:** <https://ziggit.dev/t/simplify-accessing-struct-field-values/18528>\
**Category:** Help\
**Tags:** language\
**Created:** [November 20, 2026, 2:42am UTC](https://ziggit.dev/t/simplify-accessing-struct-field-values/18528 "2026-11-20T02:42:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeeqeeng](https://ziggit.dev/letter_avatar_proxy/v4/letter/z/8baadc/32.png) [@zeeqeeng](https://ziggit.dev/u/zeeqeeng)\
**Post date:** [November 20, 2026, 2:42am UTC](https://ziggit.dev/t/simplify-accessing-struct-field-values/18528/1 "2026-11-20T02:42:54Z")

</div>

I want to merge two slices of strings since I want to append all field values of `mandoc_html_files` struct. And my current method is too dumb.

```zig
    mandoc_mod.addCSourceFiles(.{ .files = &.{
        "dbm.c",
        "dbm_map.c",
        "mansearch.c",
        "dba.c",
        "dba_array.c",
        "dba_read.c",
        "dba_write.c",
        "mandocdb.c",
        "main.c",
        "manpath.c",
        "mdoc_man.c",
        "mdoc_markdown.c",
        "out.c",
        "tree.c",
        mandoc_html_files.@"0",
        mandoc_html_files.@"1",
        mandoc_html_files.@"2",
    } });

```

Edit: the `mandoc_html_files` is a struct, not slice.

```zig
    const mandoc_html_files = .{
        "eqn_html.c",
        "html.c",
        "man_html.c",
        "mdoc_html.c",
        "roff_html.c",
        "tbl_html.c",
    };

```

---

<div class="post-metadata">

**Author:** ![vulpesx](https://ziggit.dev/user_avatar/ziggit.dev/vulpesx/32/3989_2.png) [@vulpesx](https://ziggit.dev/u/vulpesx)\
**Post date:** [November 20, 2026, 2:51am UTC](https://ziggit.dev/t/simplify-accessing-struct-field-values/18528/2 "2026-11-20T02:51:31Z")

</div>

> [@zeeqeeng](#):
>
> the `mandoc_html_files` is a struct, not slice.

it is specifically a tuple

And you can just give it an explicit type to make it a slice.

You can also just call `addCSourceFiles` multiple times
