Break segmentatio¿?!

EDIT: Shame on me. The “char k” had to be bigger for the fscanf. The same thing happened to me before… man is the only animal to trip twice over the same stone!

Hello rooters,

My question may be basic, and may be not too related with ROOT and more with C, but if you can help me it would be perfect.

I am having some trouble using FILE in the reading part of a class. I reduce the problem as much as possible and the class ends up like this:

(in Plot_results.h)
class Plot_results {

public:
Plot_results(char type, char deg, char conf);
~Plot_results();
//void plot_hist_time() ;

private:
TVector Times;
char DATANAME[80];
};
(in Plot_results.cxx)

Plot_results::Plot_results(char type[15] = “extragalactic”, char deg[2] = “20”, char conf[2] = “B”){

  if (strcmp(type,"extragalactic") == 0) const int m = 400;
  if (strcmp(type,"galactic") == 0) const int m = 304;

  Int_t n = 0;
  Int_t l = 0;

  Float_t  Cut[m], Signif[m], times[m] ;
  Char_t  kk;
  Float_t k;


  strcpy(DATANAME,"./Results/Cut_Sources/");
  strcat(DATANAME,type);
  strcat(DATANAME,"_");
  strcat(DATANAME,deg);
  strcat(DATANAME,"deg/array_");
  strcat(DATANAME,conf);
  strcat(DATANAME,".dat");

  FILE *fp = fopen(DATANAME,"r");

  fscanf(fp,"%s%s%s%s%s%s%s%s",&kk, &kk, &kk, &kk, &kk, &kk, &kk, &kk);

  for (Int_t i=0; i < m; i++){
    fscanf(fp,"%f%f%f%f%f%f%f%f",&k, &k, &k, &k, &k, &Signif[i], &Cut[i], &times[i]);
  }
  fclose(fp);
  // delete fp;
  //cout << n << endl;

  for (Int_t i=0; i < m; i++){
    if (Signif[i] >= 5.0){
    	n++;
    	//cout << Signif[i] << " y "<< Cut[i] << " y "<< times[i] << endl;
    }
  }

  Times.ResizeTo(n);

  for (int i=0; i < m; i++){
	  if (Signif[i] >= 5.0){
	      	Times[l] = times[i];
	      	l++;
	  }
  }

  Times.Print();

}

The problem that shows is a break segmentation after printing correctly the TVector. I cannot understand why does it crushes if the file is closed propperly and the vector is launched and stored correctly. (in fact the brake segmentation comes after typing any letter in the console, not while executing).

Any idea which part I am doing wrong?

Thank you for your time!!