I'm new to the Carbon language, how to perform pointer arithmetic? Is this even possible?
p = p + 1;
=>
COMPILATION ERROR: <source>:11: type error in `+`:
could not find implementation of interface AddWith(U = i32) for i32*
Compiler returned: 1
Carbon does not support pointer arithmetic. The only two operations are
*p gives the l-value p points to),&v gives the address of l-value v).More detail is available in carbon design notes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With