使用
popen功能。
示例(不完整,生产质量代码,无错误处理):
FILE* file = popen("ls", "r");// use fscanf to read:char buffer[100];fscanf(file, "%100s", buffer);pclose(file);
使用
popen功能。
示例(不完整,生产质量代码,无错误处理):
FILE* file = popen("ls", "r");// use fscanf to read:char buffer[100];fscanf(file, "%100s", buffer);pclose(file);