/* Example of calling a Labview DLL that returns a 2-D array.   */

#include <ansi_c.h>
#include <SharedLib.h>

int32 main()
{
	TD1Hdl tester = NULL;  /*  Very Important-You will get a GPF if not set to NULL*/ 
	float64 *resultLV;
	int32 row, column;
	int i, j;
	
	/* Calls the DLL function */	
	Testme(&tester);

	/* Initializes row and column count */
	row      = (*tester)->dimSizes[0];
	column   = (*tester)->dimSizes[1];
	

	/* Sets up the array pointer to do array indexing */
	resultLV = (*tester)->number0To1;


	/*  Retrieves data from the array */	
	for(i = 0; i < (*tester)->dimSizes[0]; i++)
	{
		for(j = 0; j < (*tester)->dimSizes[1]; j++)
		{
			printf("result = %f\n", resultLV[i*column + j]);
		}
	}
	return 0;
}
