Question: * Given a pointer to an aisle and a section index, return the spaces of the * section at the given index of the given

* Given a pointer to an aisle and a section index, return the spaces of the
* section at the given index of the given aisle. The returned short should
* have the least 10 significant bits set to the spaces and the 6 most
* significant bits set to 0.
*
* Can assume the index is a valid index (0-3 inclusive).
*/
unsigned short get_spaces(unsigned long* aisle, int index){
// TODO: implement this method
return (unsigned short)((*aisle >>(index * NUM_SPACES)) & SPACES_MASK);
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!