Bool of Dynamic Array

Hello fellow dev’s

I have been reading about dynamic and storage arrays and able to understand the differences between these 2. But when I look at the following syntax :

// State Variable
bool[2][] m_pairsOfFlags;

function setAllFlagPairs(bool[2][] memory newPairs) public {
    m_pairsOfFlags = newPairs;
}

  function setFlagPair(uint index, bool flagA, bool flagB) public {
        // access to a non-existing index will throw an exception
        m_pairsOfFlags[index][0] = flagA;
        m_pairsOfFlags[index][1] = flagB;
    }

My questions is how does bool of array works? from what I understand from this syntax is that it’s a pair of index : 2 fixed array of length and a new value of array will make it a true statement. Is my understanding correct?

1 Like

hmmm very intresting. this is a data structure ive never seen before. let me take this into remix play around with it and get back to u

1 Like