#How to convert *error{OutOfMemory}![]u8 to *[]u8
1 messages · Page 1 of 1 (latest)
How to convert *error{OutOfMemory}![]u8 to *[]u8
seems impossible tbf
Trying to pass an allocated var into a function
how did you get a *error{OutOfMemory}![]u8 in the first place? - this is quite an odd type
try allocator.alloc
also, should output be a *[]u8? - that's a double pointer...
it might be that you need only accept a []u8
Ok
but I want to change the variable output in the function
Oh
[]u8 is different from []const u8
do you want to change the bytes stored in the location it points to? or do you want to make it point to a different location?
point to a different location
then *[]u8 or *[]const u8 is correct
kk thx
what again is the difference between this two?
the first one lets you write to the u8s it points to, the second one doesn't
wait mb, I want to change the bytes stored in the location it points
oh then you probably just want []u8