If you have an Android device that is rooted with ADB enabled, you can access the root environment like this:
adb shell su root whoami
This should respond:
root
The breakdown of this command is:
adb Run the ADB program on your computer. For this example, it doesn't matter what OS your computer is running provided you have the appropriate adb program available via PATH. shell Run the "shell", the command-line interpreter, on the device. su Run the su program on the device. This can run programs under any account. root Tell su that you want to use the root account and, by implication, its privileges. whoami Tell su to run the whoami program, which just prints the name of the account that has run it. You can use other programs in place of whoami, it was just a convenient example for this answer.
If none of this answer meant much to you, you need to learn about using computers from their command lines. That idea is not Android-specific, and it's easier to learn it on a Windows, Linux or macOS machine. All of these have somewhat different command line systems, but the basic idea is the same on all of them. The Android command line system is a variant on the Linux one.
The "commands" you give in the question are a fragment of a C program. To run them in the root environment, you need to compile the complete program into an executable, copy it onto the device with adb push and then invoke it via su root my-executable.