input in c++ - cin.getline
<pre><code>#include&lt;iostream&gt;
#include&lt;cstdio&gt;
using namespace std;

int main()
{
    int T;
    char J[100], S[100];
    int count=0;
    cin &gt;&gt; T;

    while(T--)
    {
        cin.getline(J,100);

        cin.getline(S,100);
        puts(J);
        puts(S);

        for(int i=0; J[i]!='\0'; i++)
        {
            for(int j=0; S[j]!='\0'; j++)
            {
                count++;
                for(int k=j; S[k]!='\0'; k++)
                    S[k]=S[k+1];
                break;
            }
         }
         cout &lt;&lt; count;
    }
    return 0;
}
</code></pre>

<p>I am taking input string in J,S but during execution of program it skips the second input from the console cin.getline 
I takes the test cases then takes the Strings J and S 
it takes J successfully but fails to get S string ?</p>
