Storing a list of numbers in an integer

I am writing trying to store a list of numbers into an integer as bits. So far I have this:

n=n & 0x0f
integer = integer<<2
integer = integer | n;
convert(integer));

I want it to store the integers as bits so that I am move them over and store them farther down the row as more numbers are added, but instead each new number is being added to the previous and I'm just getting a larger integer. Can anyone point me in the right direction? Is this even a feasible way to store integers within an integer? Thanks!
Topic archived. No new replies allowed.