I am trying to pass a dynamically allocated array into a function to enter values. I have a function that allocates the array to the correct size and then that is passed into the function. My problem is that when the values are enter they don't seem to make it into the array. The program prints out a random number.
Code:
void readMatrix(double *mPtr, int size)
{
	int input = 0;
	int count = 0;

	printf("Please enter the values of your matrix row by row, left to right:\n");
	do	//begin do/while
	{
		scanf("%f", &input);
		mPtr[count] = input;
		count++;
	}while(count<size);	//end do/while

}
Whenever I try to print a value out of that do/while loop I get a number like 12486144843. I just want the inputs to make it into the array and be available outside of the function. This is passed by reference correct?