You never set a and b to point to anything. You declared them, and then set b equal to a (so they both point nowhere) and try to use them.
You're going to have to malloc some memory space, and let a and b [point to that. But, you run into a logic problem here. When you call malloc to allocate room for 1 int, the function looks for a space in memory big enough for 1 int, allocates it, and returns the address via a void*. But you are assuming that memory location has enough empty room in front of it for an unknown amount of ints. You might get lucky once in a while, and this wouldn't prove to be problematic. But more likely than not, you are going to push your pointer into other, already allocated memory, and mess up some possibly vital information.
I don't see any way you can accomplish what you want to do without malloc-ing a space big enough for n integers.
As a side note, your main should be declared
and return a 0 at the end of your program. void main() is non-standard and theoretically could do anything.