<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 26, 2021 at 7:36 AM Daniel Kozak <<a href="mailto:kozzi11@gmail.com">kozzi11@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Fri, Mar 26, 2021 at 7:31 AM Daniel Kozak <<a href="mailto:kozzi11@gmail.com" target="_blank">kozzi11@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Fri, Mar 26, 2021 at 6:50 AM Jack via Digitalmars-d-learn <<a href="mailto:digitalmars-d-learn@puremagic.com" target="_blank">digitalmars-d-learn@puremagic.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What's the equivalent of C's VLA in D? scoped from std.typecons <br>
doesn't seem to work with arrays. Should I use alloca() for my <br>
array or is there something else?<br></blockquote><div><br></div><div><a href="https://dlang.org/library/std/array/static_array.html" target="_blank">https://dlang.org/library/std/array/static_array.html</a> </div></div></div></blockquote><div>Sorry I was misread this </div></div></div></blockquote><div><br></div><div>You can use allocator:</div><div><br></div>import std.experimental.allocator.showcase;<br>import std.experimental.allocator;<br>import std.stdio;<br><br>StackFront!4096 stackAlloc;<br><br>void main() {    <br>    int[] a = stackAlloc.makeArray!int(2);<br>    writeln(a);<br><div>} </div></div></div>