Input from the execution line in the terminal in c
问题 The problem that i have is that i have to write a hanois tower game in c and the input for the number of the rings must not be in the programm but the code must read the number of rings in the execution. Example: ./ hanoistower 3 And the code should get the 3 as the input. How can i do that? 回答1: Command line arguments are propagated as strings through the main() function of your C program. In int main(int argc, char *argv[]) argc is the number of arguments, and argv is an array of strings