I tested the cin.ignore function with "data" as a char and it doesn't solve the problem. I'm going to see if does with string data...
In the meantime I corrected the coding error in the functions of the header "prova" and the error does not show up anymore. But my question remains: why calling a function (whether contained in the header or in the main project) after cin.getline should interfere with it?
#include <stdlib.h> //atoi
bool bis(int a) //Leap year
if(a%400==0 or (a%4==0 and a%100!=0)) return 1;
bool rorw(char data) //check if the date is correct
if(d>28) cout<<"Error! "<<yy<<" the year is a leap year!";
if(m<1 or m>12) std::cout<<"Inexistent month!\n";
if(d<1 or d>tab[m-1]) std::cout<<"Inexistent day!\n";
In your original post, you're assuming that the program stops before line 26 because you don't see the output from line 26. That output may be buffered, so it's entirely possible that the program is hanging after line 26, not before it. Change line 26 to cout << "hello!" << flush; to see if that's true.
Change line 26 to cout << "hello!" << flush; to see if that's true.
I cannot see it because now the cygwin exception doesn't show up anymore even if I put the error back where it was in "prova.h" (i.e. I was not considering that function "atoi" requires a null terminated string, so the size of yy,mm and dd has to added by 1).