Dates

I can't find anything wrong with this short program, but I still can't run it, because of, again, my stupid virus protection software that is blocking it -.- Could anyone help me with finding the error? :P

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;

int main(){
    char a[9], s[11]="20  -  -  ";
    cout << "Enter date mm/dd/yy: ";
    cin.getline(a, 9);
    s[2]=a[6];
    s[3]=a[7];
    s[5]=a[0];
    s[6]=a[1];
    s[8]=a[3];
    s[9]=a[4];
    cout << "Swedish date: " << s << endl;
    return(0);
}
Don't worry, I fixed it myself. I just put cin.ignore(); after cin.getline(a,9).
Topic archived. No new replies allowed.