Simple array issue

having trouble getting this to work correctly. the question is write a function called calcMean that accepts an array of doubles named data and returns the simple average (mean) of the data elements.

this is what I have so far.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  #include <iostream>



double calcMean(double A[], int arraySize)

{
	double data = 0;
	for (int i =0; i < arraySize; i++)
		data += A[i];
	double mean = data/arraySize;

	return mean;
}
	
What kind of problems are you having, here it worked fine.
after attempting to compile it, it fail with this error

1>LINK : fatal error LNK1561: entry point must be defined

and im not sure how to fix this.
try starting a new project with a different name and put your whole code in here.
its still coming up with errors

1>------ Build started: Project: final, Configuration: Debug Win32 ------
1>Build started 12/8/2013 4:06:34 PM.
1>InitializeBuildStatus:
1> Touching "Debug\final.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>LINK : fatal error LNK1561: entry point must be defined
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.34
You need to have a main() function so the computer knows where to start your program.
Last edited on
thanks for the help, had no idea it was so simple.
Topic archived. No new replies allowed.