fTotBytes error

[code]#include “TFile.h”
#include “TTree.h”
#include “TRandom.h”

#include
#include
#include

void Autocorrelation()
{
std::string output=“Auto”;
std::string title=“Auto”;
const int N=60, taumax=10;
int ret=-1, i=0, tau=0;
float u[N]={0}, u1[N]={0}, u12[N]={0}, ubar=0, u12bar=0;
float u22[taumax]={0}, u22bar=0, R=0, in;
TFile *fc2012 = new TFile((output+".root").c_str(),“recreate”); //creates new ROOT file
TTree *tc2012 = new TTree(output.c_str(),title.c_str()); //creates new tree
//tc2011.Branch(“u”,&u,“u/F”);
//tc2011.Branch(“u1”,&u1,“u1/F”);
tc2012->Branch(“R”,&R,“R/F”);
tc2012->Branch(“tau”,&tau,“tau/F”);

FILE *file = fopen("./3rdYearLab/WindTurbulence/random.csv",“r”);
if (!file) std::cout << “Autocorrelation: Warning: Using FAKE data!” <<std::endl;
for(i = 0; i < N; i++)
{
if (file) ret = fscanf(file,"%g%*c",&in);
else in = gRandom->Rndm();
u[i] = in;
//std::cout <<i<<" "<<u[i]<<std::endl;
ubar += (u[i]/N);
}

//std::cout<<ubar<<std::endl;

for (i = 0; i < N; i++)
{
u1[i] = u[i]-ubar;
u12[i] = (u1[i])*(u1[i]);
u12bar += (u12[i]/N);
//std::cout<<i<<" “<<u1[i]<<” "<<u12[i]<<std::endl;
}
//std::cout<<u12bar<<std::endl; //good to here

for(tau = 0; tau < taumax; tau++)
{
u22[tau]=0;
//std::cout<<“tau=”<<tau<<std::endl;
for(i=0;i<(N-(tau));i++)
{
//std::cout<<u22[tau]<<std::endl;
u22[tau] += (u1[i])*(u1[i+tau]);
//std::cout<<u22[tau]<<" “<<u1[i]<<” "<<u1[i+tau]<<std::endl;
}

  u22bar = u22[tau]/(N-(tau));
  R=(u22bar)/(u12bar);
  std::cout << R <<std::endl;
  tc2012->Fill();
}

tc2012->Print(); //print tree in terminal
tc2012->Write(); //write tree to file
delete fc2012;
if (file) fclose(file); //close file
}[/code]
BTW. Always try to precompile your source code using ACLiC (this will check the “C++ validity” of your source code), e.g. using something like:
root [0] .L YourMacro.cxx++
And try to run your code using valgrind:
valgrind --tool=memcheck --leak-check=full [–show-reachable=yes] [–num-callers=50] [–track-origins=yes] [–db-attach=yes] --suppressions=root-config --etcdir/valgrind-root.supp root-config --bindir/root.exe -l -q 'YourMacro.cxx[++][(Any, Parameters, You, Need)]'
or:
valgrind --tool=memcheck --leak-check=full [–show-reachable=yes] [–num-callers=50] [–track-origins=yes] [–db-attach=yes] --suppressions=root-config --etcdir/valgrind-root.supp YourExecutable [Any Options You Need]
and especially carefully study messages that appear in the beginning of the output.
(Note: the “–show-reachable=yes” option will give you too many warnings, I believe.)
Last, but not least, always try to post “complete test source code” (including required data files, or modify it so that no separate data files are needed) which one could run in order to reproduce your problem.