Inside the building it's the first floor, even if it's exactly at the sea level altitude. Outside the building it's the ground. Basement levels start at minus one, there is no zeroth floor.
If the walkway goes inside the building, then yes. And the walkway usually leads directly to the second floor, because the airplane door is 3 metres above the ground.
I stopped reading after this. Why do you think C++ is unsafe in the first place? Someone decided ro extend it, and now you cannot even read an error message without finishing an university course on lambda calculus first.
Yet I still had an urge to explain an obvious thing. Because it's C++, so everyhing goes. There are even tools to auto-generate C++ interfaces, because of course someone decided that C++ is inadequate and must be improved using some kind of poorly-documented ad-hoc extension language on top of C++.
C++ is fiiiiine. Just use the modern variant of the language, don't bother with hand-optimizing your memory allocators, and generally avoid anything involving pointer arithmetics.
So, basically, use it like you would use Python.
This needs some simple hardware trigger, that can be queried by bootloader, but specific wnough so it won't trigger in your pocket. If buttons are unavailable, I can propose several idead:
Cover the proximity sensor 10 times per second. Requires good motor skills.
Shine separated red, green, and blue lasers into three of the phone cameras. You'll need a box with three different-colored LEDs to cover cameras module.
There is a low-speed data channel in wireless chargers. Just add the button to the charger instead of the phone.
Put your phone at exactly 2.5G of acceleration. Accelerometer is easy to use even from the bootloader, however you will need to put your phone in a centrifuge and reboot it while it's rotating.
An option 'Reboot into recovery' in system settings, duh. Won't help if your ROM fails to boot.
SDL2, with Android NDK, commandline version.