Alright So, this is a simple code that I came up with for passing arrays to functions and performing a
mathematical operation on its elements.
Since I have no reference point, I would like to get an Idea of where I stand (Beginner @ the
moment, I know that much)
I would like to know if I am forming any bad habits or using some code incorrectly.
Now, I understand this is not a class but any feedback would be appreciated. I'm trying to
inch my way out of the newbie hole, and I want to make sure I'm doing it as correctly as possible

Plus, I've come to learn that not everything works the way they teach you in class, so.. anyway,

Thank You.

Code:
//Harmonic Mean
#include "stdafx.h"
#include <iostream>

void harmony ( double [],int );
void fill ();

void main()
{ 
	fill();//Call function to fill array
}

void fill ()
{
	int *pa = new double [20];  //declare pointer to array of type double of 20 blocks.
	double temp1 = 0.0;
	double temp2 = 0.0;
	int i = 0;
	
	
	std::cout<<"Enter Pairs of Numbers Separated by a Space:"<<std::endl;
	do // Prompt user for Input, use zero as a terminator.
	{
		std::cout<<": ";
		std::cin>>temp1>>temp2;
		
		if (temp1 != 0)
		{
			pa[i]=temp1;
				pa[i+1]=temp2;
					i++;
						i++;
						
		}
	
		else
			break;
	}
	while(temp1 !=0);
		
	harmony (pa, i);
	
	return;
}

void harmony ( double arg[] , int limit )
{
	double mean = 0.0;
	
	for(int x= 0; x < limit; x++)
	{  
		mean = 2 * (arg[x] * arg[x+1])/(arg[x] + arg[x+1]);
		 x++;
		std::cout<<"Mean: "<<mean<<std::endl;
	}

	std::cin.get();	
	std::cin.get();	
	return;
}