'Size' was not declared in this scope

can't figure out what's causing this error, please help!

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 4597 Views - Last Post: 14 December 2010 - 02:04 PM Rate Topic: -----

#1 ronxcode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-December 10

'Size' was not declared in this scope

Posted 13 December 2010 - 11:02 PM

Hello,

I've been at this code for the past 6 or 7 hours. I'm down to one last error and can't figure out what's causing it. Please advise! Thanks

#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;

double Calc_Average (int Size, double input[]);
double Calc_Median(int Size, double input[]);
double Calc_Std_Deviation (int Size, double average, double input[]);
double Calc_Variance (int Size, double average, double input[]);
void SortArray (int Size, int numbers_used);


int main()
{
	double count[Size];
	const int Size = 11;
	double median;
	double average;
	double std_deviation;
	double variance;
	
	string text_file;
	ifstream in_size ("numbers.txt");
	if (in_size.is_open())
	{
		while (in_size.good()) 
		{
			cout << "Enter the file to read in:" << endl;
			getline(cin, text_file);
			cout << "The numbers in the array are:" << endl;
		
	
	if(in_size.fail())
	
		cout  << "Error opening file" << endl;
	

	for (int index = 0; index < Size; index++)
	{
	
	
in_size.close();
	
	}
			SortArray(count, Size);

			average = Calc_Average ( count, Size);
			median = Calc_Median (count, Size);
			std_deviation = Calc_Std_Deviation (count, Size);
			variance = Calc_Variance (count, Size);

cout << "The average of the numbers is " << average << endl;
cout << "The median of the numbers is " << median << endl;
cout << "The standard deviation is " << std_deviation << endl;
cout << "The variance is " << variance << endl;

return 0;
}
	}
}

	double Calc_Average(int Size, double input[])
	{
		double sum = 0;
		double average = 0;

	for (int i = 0; i < Size; i++)
	{
		sum = sum + input[i];
	    average =  (sum/ Size);
	}
		return average;
	}
		
double Calc_Median (int Size, double input[])
{
	int median_td;
	double median;
		
		if(Size % 2 == 0)
		{
			median_td = (Size + 1)/2;
			median = input[median_td];
		}
		else
		{
			median_td = Size/2;
			median = input[median_td];
		}
		
		return median;
	}
		
		double Calc_Std_Deviation(int Size, double average, double input[])
		{
			double sum = 0;
			double std_deviation = 0;
			double numerator = 0;
			double denominator = Size-1;
			
			//finds the sum of the array items
			for(int i= 0; i < Size; i++)
			{
				
				sum += input[i];
			
			
			//finds the standard deviation
			for (int i = 0; i < Size; i++)
			{
				numerator = numerator + pow((input[i] - average), 2);
				
			}
			std_deviation = sqrt(numerator/denominator);
			
			return std_deviation;
			}
		}
			double Calc_Variance(int Size, double average, double input[])
			{
				double numerator = 0;
				double denominator = Size-1;
				double variance;
				
				//finds the variance
				for (int i = 0; i < Size; i++)
				{
					numerator = numerator + pow((input[i] - average), 2);
					
				
				variance = (numerator/denominator);
				
				return variance;
			}
			
		
			}


MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 14 December 2010 - 05:53 AM


Is This A Good Question/Topic? 0
  • +

Replies To: 'Size' was not declared in this scope

#2 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 988
  • View blog
  • Posts: 5,135
  • Joined: 28-September 06

Re: 'Size' was not declared in this scope

Posted 13 December 2010 - 11:05 PM

Please edit your posting (see the "EDIT" button in lower right). (If Edit is not available make a new posting on this thread and skip ( a ) below.)
( a ) Delete all your code.
( b ) Get a fresh copy of the code with formatting in place from your editor / IDE.
( c ) Paste the formatted code between code tags like this :code:
Read here for more help with the code tags
http://www.dreaminco...-code-tags-are/
( d ) Use the "Preview Post" button to check it's all good.
( e ) Use the "Submit Modified Post" button to finish the editing.


Please copy-and-paste the full and exact error message you want help with.
Always share the full and exact error message.
For a start you have failed to share the line number from the error message so one of the vital bits of information is missing.
Was This Post Helpful? 1
  • +
  • -

#3 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1833
  • View blog
  • Posts: 4,927
  • Joined: 27-December 05

Re: 'Size' was not declared in this scope

Posted 13 December 2010 - 11:16 PM

Dude, the first line of your main function is:
    double count[Size];

Doesn't your error message refer specifically to that line?

You are using the constant Size before declaring it (which you did on the next line). All you have to do to eliminate that error is switch the order of those 2 lines.

Then you can move on to correcting all the other errors that will pop up when you try to compile again. :)


Oh, and next time you post, please do post formatted, readable code between code tags as janotte requested. Just literally type [code] then your code, then [/... etc.

This post has been edited by r.stiltskin: 13 December 2010 - 11:20 PM

Was This Post Helpful? 1
  • +
  • -

#4 ronxcode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-December 10

Re: 'Size' was not declared in this scope

Posted 13 December 2010 - 11:24 PM

Hello,

Sorry about that. I've been at this code for the past 6 or 7 hours. I'm down to one last error and can't figure out what's causing it. The error is occurring on line 17 of my code.

The error message is: 'Size' was not declared in this scope

Please help! Thanks

#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;

double Calc_Average (int Size, double input[]);
double Calc_Median(int Size, double input[]);
double Calc_Std_Deviation (int Size, double average, double input[]);
double Calc_Variance (int Size, double average, double input[]);
void SortArray (int Size, int numbers_used);


int main()
{
	double count[Size];
	const int Size = 11;
	double median;
	double average;
	double std_deviation;
	double variance;
	
	string text_file;
	ifstream in_size ("numbers.txt");
	if (in_size.is_open())
	{
		while (in_size.good()) 
		{
			cout << "Enter the file to read in:" << endl;
			getline(cin, text_file);
			cout << "The numbers in the array are:" << endl;
		
	
	if(in_size.fail())
	
		cout  << "Error opening file" << endl;
	

	for (int index = 0; index < Size; index++)
	{
	
	
in_size.close();
	
	}
			SortArray(count, Size);

			average = Calc_Average ( count, Size);
			median = Calc_Median (count, Size);
			std_deviation = Calc_Std_Deviation (count, Size);
			variance = Calc_Variance (count, Size);

cout << "The average of the numbers is " << average << endl;
cout << "The median of the numbers is " << median << endl;
cout << "The standard deviation is " << std_deviation << endl;
cout << "The variance is " << variance << endl;

return 0;
}
	}
}

	double Calc_Average(int Size, double input[])
	{
		double sum = 0;
		double average = 0;

	for (int i = 0; i < Size; i++)
	{
		sum = sum + input[i];
	    average =  (sum/ Size);
	}
		return average;
	}
		
double Calc_Median (int Size, double input[])
{
	int median_td;
	double median;
		
		if(Size % 2 == 0)
		{
			median_td = (Size + 1)/2;
			median = input[median_td];
		}
		else
		{
			median_td = Size/2;
			median = input[median_td];
		}
		
		return median;
	}
		
		double Calc_Std_Deviation(int Size, double average, double input[])
		{
			double sum = 0;
			double std_deviation = 0;
			double numerator = 0;
			double denominator = Size-1;
			
			//finds the sum of the array items
			for(int i= 0; i < Size; i++)
			{
				
				sum += input[i];
			
			
			//finds the standard deviation
			for (int i = 0; i < Size; i++)
			{
				numerator = numerator + pow((input[i] - average), 2);
				
			}
			std_deviation = sqrt(numerator/denominator);
			
			return std_deviation;
			}
		}
			double Calc_Variance(int Size, double average, double input[])
			{
				double numerator = 0;
				double denominator = Size-1;
				double variance;
				
				//finds the variance
				for (int i = 0; i < Size; i++)
				{
					numerator = numerator + pow((input[i] - average), 2);
					
				
				variance = (numerator/denominator);
				
				return variance;
			}
			}


Was This Post Helpful? 0
  • +
  • -

#5 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1355
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: 'Size' was not declared in this scope

Posted 13 December 2010 - 11:27 PM

Please paste the exact error message, as it usually has a line number listed that helps narrow things down quite a bit.

This post has been edited by Kilorn: 13 December 2010 - 11:28 PM

Was This Post Helpful? 0
  • +
  • -

#6 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 988
  • View blog
  • Posts: 5,135
  • Joined: 28-September 06

Re: 'Size' was not declared in this scope

Posted 13 December 2010 - 11:31 PM

Scroll back up the thread and read the answer from r.stiltskin.

BTW
You still aren't getting it.
Use copy-and-paste. It's quicker for you and better for you.
Make things easy for yourself and use copy-and-paste of the full error message.
But it doesn't matter right now because your problem was fixed 8 minutes before you posted.

But in the future. Just use copy-and-paste.
Was This Post Helpful? 0
  • +
  • -

#7 ronxcode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-December 10

Re: 'Size' was not declared in this scope

Posted 13 December 2010 - 11:44 PM

thanks r. stiltskin! after making the switch, just as you said, I got bombarded w/ errors:

too few arguments to function on lines 10-11

invalid conversion from 'double' to 'int' on lines 47-52

where am I going wrong??? these seem like simple errors, but I am far from from good at this!

#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;

double Calc_Average (int Size, double input[]);
double Calc_Median(int Size, double input[]);
double Calc_Std_Deviation (int Size, double average, double input[]);
double Calc_Variance (int Size, double average, double input[]);
void SortArray (int Size, int numbers_used);


int main()
{
	const int Size = 11;
	double count[Size];
	double median;
	double average;
	double std_deviation;
	double variance;
	
	string text_file;
	ifstream in_size ("numbers.txt");
	if (in_size.is_open())
	{
		while (in_size.good()) 
		{
			cout << "Enter the file to read in:" << endl;
			getline(cin, text_file);
			cout << "The numbers in the array are:" << endl;
		
	
	if(in_size.fail())
	
		cout  << "Error opening file" << endl;
	

	for (int index = 0; index < Size; index++)
	{
	
	
in_size.close();
	
	}
			SortArray(count, Size);

			average = Calc_Average ( count, Size);
			median = Calc_Median (count, Size);
			std_deviation = Calc_Std_Deviation (count, Size);
			variance = Calc_Variance (count, Size);

cout << "The average of the numbers is " << average << endl;
cout << "The median of the numbers is " << median << endl;
cout << "The standard deviation is " << std_deviation << endl;
cout << "The variance is " << variance << endl;

return 0;
}
	}
}

	double Calc_Average(int Size, double input[])
	{
		double sum = 0;
		double average = 0;

	for (int i = 0; i < Size; i++)
	{
		sum = sum + input[i];
	    average =  (sum/ Size);
	}
		return average;
	}
		
double Calc_Median (int Size, double input[])
{
	int median_td;
	double median;
		
		if(Size % 2 == 0)
		{
			median_td = (Size + 1)/2;
			median = input[median_td];
		}
		else
		{
			median_td = Size/2;
			median = input[median_td];
		}
		
		return median;
	}
		
		double Calc_Std_Deviation(int Size, double average, double input[])
		{
			double sum = 0;
			double std_deviation = 0;
			double numerator = 0;
			double denominator = Size-1;
			
			//finds the sum of the array items
			for(int i= 0; i < Size; i++)
			{
				
				sum += input[i];
			
			
			//finds the standard deviation
			for (int i = 0; i < Size; i++)
			{
				numerator = numerator + pow((input[i] - average), 2);
				
			}
			std_deviation = sqrt(numerator/denominator);
			
			return std_deviation;
			}
		}
			double Calc_Variance(int Size, double average, double input[])
			{
				double numerator = 0;
				double denominator = Size-1;
				double variance;
				
				//finds the variance
				for (int i = 0; i < Size; i++)
				{
					numerator = numerator + pow((input[i] - average), 2);
					
				
				variance = (numerator/denominator);
				
				return variance;
			}
			
		
			}
		

	 
								   



View Postjanotte, on 13 December 2010 - 10:31 PM, said:

Scroll back up the thread and read the answer from r.stiltskin.

BTW
You still aren't getting it.
Use copy-and-paste. It's quicker for you and better for you.
Make things easy for yourself and use copy-and-paste of the full error message.
But it doesn't matter right now because your problem was fixed 8 minutes before you posted.

But in the future. Just use copy-and-paste.


can't copy and paste the errors w/ xcode c++, sorry...i understand it's easier and would do so if i could
Was This Post Helpful? 0
  • +
  • -

#8 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 988
  • View blog
  • Posts: 5,135
  • Joined: 28-September 06

Re: 'Size' was not declared in this scope

Posted 13 December 2010 - 11:55 PM

Look at line 10.
What are you using there that you have not defined?

HINT
Same constant as the last error!
Was This Post Helpful? 1
  • +
  • -

#9 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1833
  • View blog
  • Posts: 4,927
  • Joined: 27-December 05

Re: 'Size' was not declared in this scope

Posted 13 December 2010 - 11:59 PM

Look at the parameter lists of Calc_Std_Deviation and Calc_Variance. They each take 3 arguments: int, double, double. But when you call the functions in main, you are only supplying 2 arguments.

Not only do the number of arguments in the function calls have to agree with the function prototypes and the function definitions, but the types of the arguments have to agree as well. Compare the arguments that you are supplying in main where you call the functions with the types and numbers of arguments in the prototypes and in the function definitions & you will see what's causing your error messages.
Was This Post Helpful? 1
  • +
  • -

#10 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 988
  • View blog
  • Posts: 5,135
  • Joined: 28-September 06

Re: 'Size' was not declared in this scope

Posted 14 December 2010 - 12:17 AM

Ah a Mac user.
Okay here is how to make your life easier as far as the error messages go.

Right click on main.cpp in XCode and choose "Reveal in Finder"

Open Terminal.app.
Type 'cd '. [space after the d]
Drag the folder containing your C++ file from Finder onto the Terminal window. See the green plus sign appear? Release the mouse button (or similar for trackpad).
Look at what is in Terminal. You now have the path to the folder the C++ file is in Terminal preceded by 'cd '.
Hit Return.

Terminal has now changed your working directory to the folder holding you main.cpp file.

In Terminal type this:
g++ -Wall main.cpp
That is the command to compile your main.cpp file with all warnings displayed.
Hit Return.

Now you have all the warning and error messages from XCode but in Terminal where you can copy-and-paste them.

Nifty hey?
Give it a try.

This post has been edited by janotte: 14 December 2010 - 12:33 AM

Was This Post Helpful? 0
  • +
  • -

#11 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1833
  • View blog
  • Posts: 4,927
  • Joined: 27-December 05

Re: 'Size' was not declared in this scope

Posted 14 December 2010 - 12:33 AM

@janotte: that won't tempt me to get a Mac, but it can benefit a lot of people. You should try to get the mods to post those instructions in a "pinned" thread at the top of the C/C++ forum.
Was This Post Helpful? 0
  • +
  • -

#12 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 988
  • View blog
  • Posts: 5,135
  • Joined: 28-September 06

Re: 'Size' was not declared in this scope

Posted 14 December 2010 - 12:39 AM

@ r.stiltskin

Great minds think alike <haha>.

Having typed it all out I thought I might try and clean it up and enhance it as a mini tutorial and see if it might be accepted.
We shall see.

The problem with XCode is that it tries a bit too hard to be clever.
NIce when it's helpful but when it is annoying it is sooooooo annoying.
Was This Post Helpful? 0
  • +
  • -

#13 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5957
  • View blog
  • Posts: 23,226
  • Joined: 23-August 08

Re: 'Size' was not declared in this scope

Posted 14 December 2010 - 06:13 AM

View Postjanotte, on 14 December 2010 - 01:17 AM, said:

Ah a Mac user.
Okay here is how to make your life easier as far as the error messages go.


Here's an even easier method!

When the build fails, open the Build Results screen (Build->Build Results or Shift-Command-B). Click on the Build <projectname> row at the top of the error list window and Command-C to copy. The results, like below, are now in the clipboard:

Build ronxcode of project ronxcode with configuration Debug

CompileC build/ronxcode.build/Debug/ronxcode.build/Objects-normal/x86_64/main.o main.cpp normal x86_64 c++ com.apple.compilers.gcc.4_2
cd "/Users/jack/xcode projects/dic/ronxcode"
setenv LANG en_US.US-ASCII
/Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/MacOSX10.6.sdk -mfix-and-continue -fvisibility-inlines-hidden -mmacosx-version-min=10.6 -gdwarf-2 -iquote "/Users/jack/xcode projects/dic/ronxcode/build/ronxcode.build/Debug/ronxcode.build/ronxcode-generated-files.hmap" "-I/Users/jack/xcode projects/dic/ronxcode/build/ronxcode.build/Debug/ronxcode.build/ronxcode-own-target-headers.hmap" "-I/Users/jack/xcode projects/dic/ronxcode/build/ronxcode.build/Debug/ronxcode.build/ronxcode-all-target-headers.hmap" -iquote "/Users/jack/xcode projects/dic/ronxcode/build/ronxcode.build/Debug/ronxcode.build/ronxcode-project-headers.hmap" "-F/Users/jack/xcode projects/dic/ronxcode/build/Debug" "-I/Users/jack/xcode projects/dic/ronxcode/build/Debug/include" "-I/Users/jack/xcode projects/dic/ronxcode/build/ronxcode.build/Debug/ronxcode.build/DerivedSources/x86_64" "-I/Users/jack/xcode projects/dic/ronxcode/build/ronxcode.build/Debug/ronxcode.build/DerivedSources" -c "/Users/jack/xcode projects/dic/ronxcode/main.cpp" -o "/Users/jack/xcode projects/dic/ronxcode/build/ronxcode.build/Debug/ronxcode.build/Objects-normal/x86_64/main.o"

/Users/jack/xcode projects/dic/ronxcode/main.cpp: In function 'int main()':
/Users/jack/xcode projects/dic/ronxcode/main.cpp:47: error: invalid conversion from 'double*' to 'int'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:47: error:   initializing argument 1 of 'void SortArray(int, int)'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:49: error: invalid conversion from 'double*' to 'int'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:49: error:   initializing argument 1 of 'double Calc_Average(int, double*)'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:49: error: invalid conversion from 'int' to 'double*'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:49: error:   initializing argument 2 of 'double Calc_Average(int, double*)'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:50: error: invalid conversion from 'double*' to 'int'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:50: error:   initializing argument 1 of 'double Calc_Median(int, double*)'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:50: error: invalid conversion from 'int' to 'double*'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:50: error:   initializing argument 2 of 'double Calc_Median(int, double*)'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:51: error: invalid conversion from 'double*' to 'int'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:10: error: too few arguments to function 'double Calc_Std_Deviation(int, double, double*)'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:51: error: at this point in file
/Users/jack/xcode projects/dic/ronxcode/main.cpp:52: error: invalid conversion from 'double*' to 'int'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:11: error: too few arguments to function 'double Calc_Variance(int, double, double*)'
/Users/jack/xcode projects/dic/ronxcode/main.cpp:52: error: at this point in file


Was This Post Helpful? 1
  • +
  • -

#14 ronxcode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 13-December 10

Re: 'Size' was not declared in this scope

Posted 14 December 2010 - 10:42 AM

still having trouble w/ line 47 guys. giving the following error:

/Users/RonLeesMac/Documents/school shit/nats_final/main.cpp: In function 'int main()':
/Users/RonLeesMac/Documents/school shit/nats_final/main.cpp:48: error: 'input' was not declared in this scope





#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;

double Calc_Average (int Size, double input[]);
double Calc_Median(int Size, double input[]);
double Calc_Std_Deviation (double Size, double average, double input[]);
double Calc_Variance (double Size, double average, double input[]);
void SortArray (double Size, double input[]);


int main()
{
	const int Size = 11;
	double count[Size];
	double median;
	double average;
	double std_deviation;
	double variance;
	
	string text_file;
	ifstream in_size ("numbers.txt");
	if (in_size.is_open())
	{
		while (in_size.good()) 
		{
			cout << "Enter the file to read in:" << endl;
			getline(cin, text_file);
			cout << "The numbers in the array are:" << endl;
		
	
	if(in_size.fail())
	
		cout  << "Error opening file" << endl;
	

	for (int index = 0; index < Size; index++)
	{
		cin >> count[index];
	}
in_size.close();
	
	}
			SortArray (Size, input);

			average = Calc_Average (Size, input);
			median = Calc_Median (Size, input);
			std_deviation = Calc_Std_Deviation (Size, input);
			variance = Calc_Variance (Size, input);

cout << "The average of the numbers is " << average << endl;
cout << "The median of the numbers is " << median << endl;
cout << "The standard deviation is " << std_deviation << endl;
cout << "The variance is " << variance << endl;

return 0;
}
	}


	double Calc_Average(int Size, double input[])
	{
		double sum = 0;
		double average = 0;

	for (int i = 0; i < Size; i++)
	{
		sum = sum + input[i];
	    average =  (sum/ Size);
	}
		return average;
	}
		
double Calc_Median (int Size, double input[])
{
	int median_td;
	double median;
		
		if(Size % 2 == 0)
		{
			median_td = (Size + 1)/2;
			median = input[median_td];
		}
		else
		{
			median_td = Size/2;
			median = input[median_td];
		}
		
		return median;
	}
		
		double Calc_Std_Deviation(int Size, double average, double input[])
		{
			double sum = 0;
			double std_deviation = 0;
			double numerator = 0;
			double denominator = Size-1;
			
			//finds the sum of the array items
			for(int i= 0; i < Size; i++)
			{
				
				sum += input[i];
			
			
			//finds the standard deviation
			for (int i = 0; i < Size; i++)
			{
				numerator = numerator + pow((input[i] - average), 2);
				
			}
			std_deviation = sqrt(numerator/denominator);
			
			return std_deviation;
			}
		}
			double Calc_Variance(int Size, double average, double input[])
			{
				double numerator = 0;
				double denominator = Size-1;
				double variance;
				
				//finds the variance
				for (int i = 0; i < Size; i++)
				{
					numerator = numerator + pow((input[i] - average), 2);
					
				
				variance = (numerator/denominator);
				
				return variance;
			}
			
		
			}
		

	 
								   


Was This Post Helpful? 0
  • +
  • -

#15 jimblumberg  Icon User is offline

  • member icon


Reputation: 3845
  • View blog
  • Posts: 11,753
  • Joined: 25-December 09

Re: 'Size' was not declared in this scope

Posted 14 December 2010 - 10:48 AM

Quote

main.cpp:48: error: 'input' was not declared in this scope


So where in main before line 48 did you declare "input"?

What type of variable is input, a double, a string, a char?

Jim
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2