You are taking quiz solidityquiz.com/q/sgntm. After 0 of 10 questions, you have 0.00 points.
Question #6 Difficulty:
According to the Solidity 0.8.17 compiler (200 optimization runs)
// What does C.g() return?
contract C {
struct S {
uint x;
}
function f(S memory s) private pure {
s.x = 2;
}
function g() external pure returns (uint) {
S memory s;
s.x = 1;
f(s);
return s.x;
}
}
Hint:
A memory object passed into a function taking a memory parameter will pass it in by reference.
Mode : Quiz
If you want to quit the current quiz and go back to training mode, click here.