Why?
It's not going to be faster.
The sort is O(n log n). So the fastest you could hope to be while doing it during the sort is O(n log n) comparsions (and you can't do it in one comparison).
The loop at the end is O(n). And if you want to speed that up, do it as:
int i = 0;
while (0 < arr[i] && i < n)
i++;
int PosCount = n - i;
Which is O(n).
Or if you expect n to be huge, do a binary search:
left = 0;
right = n - 1;
while (left > right) {
int i = (left + right)/2;
if (0 < arr[i]) {
right = i;
} else {
left = i;
}
}
int PosCount = n - left;
Which is O(log n)
The only reason I could see for wanting to count the positive numbers while sorting is either this is a homework assignement, or the array is much larger than physical memory and you don't want to incurr the cost of paging it all in again. But if that's the case, the heap sort is going to cause all kinds of memory thrashing and that'll be a worse problem then your nice linear or binary search.