多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
``` /* * cpp_use_tertmine.cxx * * Copyright 2020 Unknown <yhp@yhp-PC> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * */ #include <iostream> using namespace std; int main(int argc, char **argv) { char cmd[] = "zenity --question --title=\'提示\' --text=\'是否升级?';echo $?;exit;"; char buf[10241] = {0}; FILE *fp; //0-是 1-否 if((fp = popen(cmd, "r")) != NULL) { fgets(buf, 255, fp); pclose(fp); } return 0; } ``` ![](https://img.kancloud.cn/17/76/177686014fd42e12cc6fed034daffcfc_627x375.png)