Functions - Compiler doesn't recognize

So I've been working on an array workout program for class. It involves several different functions and for some reason when I compile the code it only wants to return the previous results and doesn't even recognize the newest function I've added. Actually it doesn't even recognize any changes for example I have placed a simple cout statement in main just to see what's going on and it still doesn't print it.

My code is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#include <iostream>
#include <fstream>
#include <cmath>

using namespace std;

void readF(int bry[], int &sz);
void OrigPrintF(int bry[]);
int AverageF(int cry[], int sum, int sz);
int Largest(int cry[], int sz, int &LgIndex);

ifstream inputFile;
int size;
int sum;
int ary[100];

int main()
{
	int average;
	int LgNum;
	int SmNum;

	cout << "This is an array workout program designed to manipulate an array.\n" << endl;

	
	OrigPrintF(ary);
	cout << "\n";
	cout << endl;
	
	average = AverageF(ary, sum, size);
	LgNum = Largest(ary, size, LgIndex);
	
	cout << "Original Array Average: " << average << "\n" << endl;
	cout << "Largest Number in Array: " << LgNum << "\n" << endl;

	system("PAUSE");
	return 0;
}

///////////////////////////Funcion to read input into array//////////////////////////////
void readF(int bry[], int &sz)
{
	int i = 0;
	

	inputFile.open("E:\\array.txt");
	
	if (inputFile.fail())
	{
		cout << "Cannot open file array.txt!" << endl;
		return;
	}

	while (inputFile != 0)
	{
		inputFile >> bry[i];
		i++;
	 
	}

	

	sz = i;

	return;
}
//////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////Funcion to print input from array//////////////////////////////
void OrigPrintF(int bry[])
{
	int i = 0;
	readF(ary, size);
	
	cout << "Original array printed 10 numbers per line: " << endl;
	while (bry[i] != 0)
	{
		
		if ((i % 10) == 0)
		{
			
			cout << endl;
			
		}
		cout << bry[i] << " "; 
		i++;
		
	}
	return;
}
//////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////Funcion to print average of array//////////////////////////////
int AverageF(int bry[], int sum, int sz)
{
	int i = 0;
	sum = 0;

	while (i < sz)
	{
		sum = sum + bry[i];
		i++;
	}

	sum = sum / sz;

	//cout << "Average: " << sum << endl;

	return sum;
}
//////////////////////////////////////////////////////////////////////////////////////////


///////////////////FUNCTION THAT LOCATES THE LARGEST NUMBER IN ARRAY//////////////////////
int Largest(int cry[], int sz, int &LgIndex)
{
	readF(ary, size);
	int index = 0;
	int BO = cry[0];
	

	for (i = 0; i < sz; i++)
	{
		if (cry[i] > BO)
		{
			BO = cry[i];
			index = i;
		}
	}
	
	return BO;
}
//////////////////////////////////////////////////////////////////////////////////////////



What am I missing?
Also, the new function is the Largest(cry[], sz, LgIndex).
I hate to state the obvious... but did you recompile?
I've tried rebuilding the solution and then compiling again, but that doesn't help me. Is that the same as recompiling or am I missing something. Again, I am a beginner so any and all help is greatly appreciated.

I'm using VS 2010 Express.
First, before we go on:

31: LgIndex isn't an object declared in that scope.

124: You're missing an int before i.

Second, are you sure you're building the right project? I remember that when I was starting programming sometimes I'd have two projects open at once but it was always building the first one I opened and I'd have to manually switch it. That was VC++ 2008, but...

-Albatross
I didn't currently have any projects running at the time I tried to recompile this one, but I've copied my code and began a new project and once I fixed the errors it ran great.

Still confused on why it won't run in the original project.

Just so I'm clear on what I did I was rebuilding the solution from the solution explorer.
I was right clicking the project and rebuilding it. Then right clicking the cpp file and compiling it.

But, there has to be a way to compile and run my original project other then copying the code and creating a new project (which I've done).

Thanks,

Chris
Topic archived. No new replies allowed.