Memory

Solidity

परिभाषा

Memory एक temporary data location है जो function execution के दौरान exist करता है। Memory variables function call के बाद erase हो जाते हैं। Memory storage से काफी cheaper है। Complex types (arrays, structs) को explicitly memory या storage specify करना पड़ता है।

English version

Memory is a temporary data location that exists during function execution. Memory variables are erased after the function call. Memory is much cheaper than storage. Complex types (arrays, structs) must explicitly specify memory or storage.

Code Example

function processData(uint[] memory data) public pure returns (uint) {
    // 'data' existe seulement pendant l'exécution
    uint sum = 0;
    for (uint i = 0; i < data.length; i++) {
        sum += data[i];
    }
    return sum;
}

// Array en memory
uint[] memory tempArray = new uint[](10);

संबंधित शब्द

Solingo पर इस concept को practice करें

Memory को interactive exercises और integrated IDE के साथ master करें।

मुफ्त में शुरू करें