• Asked to answer
    + 1 comment

    when using cin and getline for input, need to be careful, as cin does not read next line character, but the next getline function read tht character . So need to use getline twice. I tried cin.ignore before getline,but some problem was ther, may be u can give a try. before getline(cin,s1) add getline(cin,dummystring),