🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
``` /* * 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)