int m,d,y;
while(!CheckDate(m,d,y)){
cin>>m;
cout<<"/";
cin>>d;
cout<<"/";
cin>>y;
}
my problem is when user type something like 11/12/1986 instead of 11[pressenter]/12[pressenter]/1986 the loop will never stop! this is my first problem. I used the scanf("%d/%d/%d",&m,&d,&y);
but this one also fail when the validation returns false.
second problem is let say user enter in right way like 11[pressenter]/12[pressenter]/1986 but the validation fail let say enter month 35, so because of loop he he/she forced to input date again but the previous entered date still shown on screen(cant use system("cls") because of situation of my code -more than 1300 lines ;)-)
And yes, you could do "\b \b" but I don't know if it will work. \b is just back-space, and doesn't delete anything.
In the articles section is an article on clearing the terminal/console. Try one of the methods in there.
By the way, use getline(file, buffer) for std::strings, e.g. std::getline(std::cin, myStdString);.
Glad to have helped.
Btw, R0mai, I'd never heard of that lib. I think writing your own functions for that is far more fun and satisfying though. One time I was doing a program, I forget what for, and I wrote a function, very similar to his, to use find, substr, atof, etc, to return the decimal equiv of a fraction. Someone on here helped me, actually. Anyway I was all pleased and stuff. Ten minutes later I found a library on Google for fraction handling...
chrisname : Yes writing this kind of stuff is pretty fun (I did this kind of date program myself), but when it comes to do more difficult problems, like comparing, subtracting dates (with all the leap years/seconds etc.) it can become frustrating to debug every little problem, and if you don't write your program just for this purpose, it's pretty unnecessary to spend time on it when there is a perfectly working robust easy-to-use library.