NEWTON
Asked
4 months ago
5
views
0
This isn't a starknet question, but raw cairo. is it possible to use a pointer reference like let, and set it to a pointer with a hint, without doing a memory allocation?
looks like the answer is yes, but you do need to assign a reference when you declare a pointer reference with let, but that doesn't alter the memory
e.g.
let s : felt* = cast(ap, felt*) { ids.s = some_other_reference }
the cast(ap, felt*)
does nothing, just satisfies the compiler by having something on the rhs of a let
Newton
asked
4 months ago
0
Just
local s: felt*
should work. I guess you'll need to use something like
ids.s = s
memory[s] = whatever
answered
4 months ago
how I could read a felt* from ap in Cairo lang?
A switch statement in Cairo lang to set two distinct values
How to use get_fp_and_pc in Cairo Lang?
Cairo Lang / StarkNet: What are Revoked references? What is alloc_locals?
Revoked References exercise from Cairo-lang
Are you able to nest mappings in Cairo like you can in Solidity?
How to submit a StarkNet contract?
When will Kakarot zkEVM launch on mainnet?
How do I create AX (ArgentX) contract using starknetjs?
Is there a way to cache context + StarkNet state?
CairoLang error: `GatewayError: {'contract_address': ['Expected hex string, got:
How to get private key/mnemonic for account that been created using `deploy_account` [StarkNet]?
What does ret do in Cairo?
How do I create account using starknetjs?