c++编程有关问题,这是c++primer plus 的例程,可是。

c++编程问题,这是c++primer plus 的例程,可是。。
//sumafile.cpp --functions with an array argument 
#include<iostream>
#include<fstream>
#include<cstdlib>
using namespace std;
const int SIZE = 60;
int main()
{
char filename[SIZE];
ifstream inFile; //object for handing file input 
cout << "Enter name of date file : ";
cin.getline(filename,SIZE);
inFile.open(filename); //associate infile with a file
if (!inFile .is_open ())
{
cout << "could not open the file "<<filename <<endl;
cout <<"program terminating.\n";
exit(EXIT_FAILURE);
}
double value ;
double sum = 0.0;
int cout = 0; // number of items read

inFile >> value ; //get first value
while (inFile.good()) //while input good and not at eof
{
++cout; //one more item read
sum += value; //calculate running total
inFile >>value; //get next value
}
if (inFile.eof())
std::cout << " end of file reached .\n";
else if (inFile.fail())
std::cout<<"input terminate by date mismatch.\n";
  else 
std::cout <<"Input terminated for unkonwn reason .\n";
if (count==0)
  std::cout <<"No date processed.\n";
else 
{
std::cout <<"Items read :" << count <<endl;
std::cout <<"sum:"<<sum<<endl ;
std::cout << "Average :"<<sum / count << endl;

}
inFile.close();
return 0;

}
在vs2012上编写后 后半部分不用std::就不行,为什么,,,明明最开始都已经使用名称空间了。。。还有,例程编写后在vs2012上会显示count的形参不对应,或者是找不到是哪一个。高手看看是怎么一回事????

------解决方案--------------------
原因在于你的笔误,int cout = 0; // number of items read这条语句中,把count误写为cout了,所以和cout也重名了,造成后面必须加std::来区分,当然count也是找不到的。
------解决方案--------------------
你定义了COUT,后面就默认你的cout指的就是你定义的这个cout,所以你必须用标准空间中定义的这个cout来区分了。
------解决方案--------------------
int cout = 0; // number of items read
估计是想定义成count,笔误写错了,写成cout
------解决方案--------------------
cout 重名了。、
------解决方案--------------------
先把分结了吧。

探讨

原来如此,多谢各位帮忙呀,。。。嘿嘿,我刚开始学,但热情十足呀,以后有问题还得请教各位高手。。。

------解决方案--------------------
过路万岁,oh yeah