酷代码 AI
菜单
全部AI  /  热门  /  AI写代码神器
服务商

在linux用户态给我一个c语言程序,要求和“ifconfig eth0 192.168.1.13 netmask 255.255.255.0”功能一模一样

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> int main() { char command[100]; char ip_address[] = "192.168.1.13"; char netmask[] = "255.255.255.0"; sprintf(command, "ifconfig eth0 %s netmask %s", ip_address, netmask); system(command); return 0; } [2024-09-05 14:57:11 | AI写代码神器 | 205点数解答]

相关提问