Date input

Hey all :)
If i have to input a date, lets say 11/12/08 into separate int's, how do i do that? Please help :o
I tried to get separate 2 char arrays putting a cin.ignore(); but stringstream convert(tmp);
doesn't work for some reason
Last edited on
I don't think I quite understand your question. Do you mean the the user inputs a date, for example 11/12/08 and you would like the program to break this up into 3 different ints one representing the day, one representing the month and one the year?
Yes, i want there to be three integers, a = 11, b = 12, c = 08
ifstream in("input.txt");
int d[3];
char s;
for(int i = 1; i <=3; i++){
in >> d[i];
in >> s;
}

Solved.
Topic archived. No new replies allowed.