Execute sudo command in C with system()
问题 I am writing a piece of C code that will run some sudo command in system("sudo ip route ...") function call. This call is being done in a pthread created by the main thread, and the main program is being executed with sudo ./program when starting up. When I run the program, Ubuntu prompts me to enter password for nobody: [sudo] password for nobody: I also tried to do system("ip route ...") straightly but it gives me negative return meaning that it is not executed. What should I do in the