how to signify esc key in cpp

#include <iostream>
#include <conio.h>

int main() {
    char ch;

    do {
        ch = _getch();
        if (ch == 27) {
            // ESC key pressed
            break;
        }
        // Add your code here for processing other keys
    } while (true);

    return 0;
}