So I'm practicing some programming interview questions, and stumbled across this sample pdf which recommends "Understand how to use masks and create them in an machine independent way". But it doesn't eloborate the difference between machine dependent and machine independent mask.
I usually just figure out the integer that provides the mask that I want, for example if I only want the last 4 bits I would do:
int y = x & 15;
I don't understand why this would be machine dependent, if it is.
So what is an example of creating a mask that is machine independent? And what is an example of creating a mask that is machine dependent?
Perhaps what they are talking about is what if you need a mask for something that isn't an integer, in which case my approach wouldn't work (I've never needed a mask for anything except for integers)?