PHP Code:
#include <iostream>
#include <cstring>
using namespace std;

int main()
{
    const 
unsigned int MAX 256;
    
char pszCmd[MAX];

    do
    {
        
cin.getline(pszCmdMAX'\n');
        
cout << pszCmd << endl;
    } while(
strcmp(pszCmd"/q"));
    return 
0;

Works without problems, no "hit enter twice" or such.