I would change:
int asize = (sizeof(ageset))/4; //divide by 4 since ints are held in packs of 4 bits
That way you maintain portability and you don't have to know or rely on an int being 32-bits (although it generally will be nowadays).
int asize = (sizeof(ageset))/sizeof(asize);
Inside your function, you have the right idea except you're adding to y by way too much.
Pretend this is an array of size 5 that contain garbage:
In your function, it's like this:
, , , , [-7312]
If you add one to y, since y is a pointer, it's taken to mean that you want to point to the next element, like this:
y -> , , , , [-7312]
Now take a look at what you're adding to y in your function and see how this differs.
[b], y -> , , , [-7312]