NEWTON
Asked
4 months ago
3
views
0
In the following function I am presented with the following error, even though my code does not make it to this function. What am I doing wrong?
func fill_in_row{output_ptr: felt*}(row_idx : felt, row_size : felt, curr_row : felt*) {
if (row_idx == row_size-2) {
return ();
}
let val : felt = curr_row[row_idx-1] + curr_row[row_idx];
serialize_word(val);
curr_row[row_idx+1] = val;
return fill_in_row(row_idx+1, row_size, curr_row);
}
Error: code:80:5: While expanding the reference 'curr_row' in:
curr_row[row_idx+1] = val;
^******^
code:72:73: Expected a register. Found: [fp + (-4)].
ㅤ This question was originally posted on Triality
0
In this case you forgot to use assert
to set the value of a memory cell in the array.
The line in question should be:
assert curr_row[row_idx+1] = val;
Then you will not have that problem
ㅤ This answer was originally posted on Triality
answered
4 months ago
Cairo 0.10.0 Error: Cannot unpack return value error
Cairo Error: Getting Expected expression of type 'felt', got '(res : felt)'
Cairo Error: Unexpected token Token('LPAR', '('). Expected: identifier.
Cairo Error: Getting Expected expression of type 'felt', got '__main__.getCurrNumber.Return'
Cairo Error: 'While expanding the reference 'test_struct' in'
How to use get_fp_and_pc in Cairo Lang?
Cairo: How do I initialize an array in cairo
How to write a struct in storage?
Infinite Recursion Error on Cairo Compile
How to transpile multiple contracts at once using warp?
Cairo Error: Getting Expected expression of type 'felt', got '(res : felt)'
How to use Pedersen Hash in StarkNet / Cairo Language?
Is there anything wrong with the testnet?
Declaring Strings in Cairo