I'm making this program to check a number, and see if it's valid.

It is reading the numbers in from a text file, and the loop is made to make it keep taking in the numbers from the text file, until it reaches eof.

Problem is, the second time it runs through the loop there occur some errors in the part with the pointer 'i'. After the first round, the integers values gets all wrong. When I try to set i = 0, it crashes my compiler.

Please take a look and let me hear if you know what to do.
Code:
int Iday, Imonth, Iyear, Ictrlnr, Igen, test = 0;

char input[12], day[3], month[3], year[3], ctrlnr[4], gen[2];

char* i = input;

  ifstream b_file ( "testen.txt" );

  while(!b_file.eof())
  {

  b_file >> input;

  cout << endl << input;

  //cout << "Indtast cprnr. i formatet xxxxxx-xxxx ";
  //cin  >> input;

  if(input[11]!='\0')
    test = 1;

  strncpy(day, i, 2);
  i += 2;

  strncpy(month, i, 2);
  i += 2;

  strncpy(year, i, 2);
  i += 3;

  strncpy(ctrlnr, i, 3);
  i += 3;

  strncpy(gen, i, 1);

  Iday = atoi(day);
  Imonth = atoi(month);
  Iyear = atoi(year);
  Ictrlnr = atoi(ctrlnr);
  Igen = atoi(gen);

  cout << endl << Iday << Imonth << Iyear << "-" << Ictrlnr << Igen;

  if(Imonth == 1 || Imonth == 3 || Imonth == 5 || Imonth == 7 || Imonth == 9 || Imonth == 11)
  {
    if(Iday > 31)
      test = 1;
  }
  else if(Imonth == 4 || Imonth == 6 || Imonth == 8 || Imonth == 10 || Imonth == 12)
  {
    if(Iday > 30)
      test = 1;
  }
  else if(Imonth == 2)
  {
    if(Iyear%4 == 0)
    {
      if(Iday > 29)
        test = 1;
    }
    else if(!Iyear%4 == 0)
    {
      if(Iday > 28)
        test = 1;
    }
  }
  else if(Imonth > 12)
    test = 1;

  if(Iyear > 99)
    test = 1;

  if(Iday > 31)
    test = 1;


  if(test == 0)
    cout << endl << input <<" is a valid cprnr. ";
  else if(test == 1)
    cout << endl << input << " is not a valid cprnr. ";
  }
  cin  >> test;

  return 0;
}