First of all:
void main is incorrect.
It should be int main(). And because it's int main() it should have a return statment. Although in C++ that is not required.
Secondly, you should read the section of your book on pointers. Your problem is at:
void PopulateArray(int r, int size)
Just because you are using pointers does not mean the laws of the language have changed. In this, r is a local variable containing one value which is an integer.
This means that:
*(q+i)
Is out of bounds, since int r only holds one location for an integer.
Also, your conditional makes very little sense.
for (int i=0; i> *(q+i);
(I assume you mean to finish that as i++)
You want to interate while i is greater than the value at q[i]? What? This means your code is quickly going to go out of bounds of q..
You should seriously reread the section of yoru book on pointers. If your book is no good, Thinking In C++ by Bruce Eckel is available freely online, just google for it.
please take another look...the paste didn't work right because i left a < sign which turned everything else into an html tag. question: how do i pass a pointer to a function? or, how do i pass a dynamically created array to a function (without using indices)?