I would change:

Code:
int asize = (sizeof(ageset))/4;  //divide by 4 since ints are held in packs of 4 bits
To this:

[code]
Code:
int asize = (sizeof(ageset))/sizeof(asize);
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).

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:

Code:
[1321], [2356], [9234], [2332423], [-7312]
In your function, it's like this:

Code:
y -> [1321], [2356], [9234], [2332423], [-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:

Code:
[b][1321], y -> [2356], [9234], [2332423], [-7312]
Now take a look at what you're adding to y in your function and see how this differs.