Maybe there is an answer for this but i couldn't find one i understand, so forgive me.
Say you have a variable with an unsigned int (32-bits) foo which i want to use for storing values in. As an example i want to store the values 1 and 4 inside the unsigned int as flags which makes the corresponding binary places to 1. foo would then look like all zeros until the last eight bits where it would be 0001 0010 (where the rightmost 0 represents the value 0). How do i do this using bitmanipulation?