#Question

1 messages · Page 1 of 1 (latest)

true steppe
#

This question is incredibly vague, but in the general case, you will use pointers in Zig yes

scarlet girder
#

Not everywhere, but also not never

#

You use them when needed

#

A single element of a type is best passed directly as a value instead of as a pointer to the value

#

Unless this single element is very large like a big structure or array

#

Or when you need that element to survive for longer than the current scope, so you do dynamic allocation

#

And when you have more than one of that element and you don't know how many ahead of time, pointers are almost necessary