我如何修复“无人认领的断点” QT中的错误

发布于 2025-01-27 13:14:52 字数 751 浏览 0 评论 0原文

嗨,我在下面有我的程序,但它显示以下错误,这导致它不运行,我是QT的新手:

c:\ users \ panas \ oneDrive \ desktop \ lests \ sass1question1 \ stoneprocessor \ main.cpp:66:error:Error:Expection' 。 。 66 | } while(!validateInput(input.at(0))); |

这是错误来自的代码段:

int main(int argc, char *argv[]) {
    QApplication a(argc, argv);

    int answer = 0;
    QStringList input;

    do {
        do {
            input = getSentence();
            if (input.at(1) == "cancel")
        } while (!validateInput(input.at(0)));

        QString result = generateOutput(input.at(0));
        displayOutput(result);
        answer = tryAgain();

    } while (answer == QMessageBox::Yes);
    return EXIT_SUCCESS;
}

Hi i have my program below but it's showing the following error which is causing it not to run, I'm new to Qt:

C:\Users\panas\OneDrive\Desktop\Lessons\Ass1Question1\SentenceProcessor\main.cpp:66: error: expected primary-expression before '}' token
..\SentenceProcessor\main.cpp: In function 'int qMain(int, char**)':
..\SentenceProcessor\main.cpp:66:9: error: expected primary-expression before '}' token
66 | }while(!validateInput(input.at(0)));
|

Here is the code snippet where the error is coming from:

int main(int argc, char *argv[]) {
    QApplication a(argc, argv);

    int answer = 0;
    QStringList input;

    do {
        do {
            input = getSentence();
            if (input.at(1) == "cancel")
        } while (!validateInput(input.at(0)));

        QString result = generateOutput(input.at(0));
        displayOutput(result);
        answer = tryAgain();

    } while (answer == QMessageBox::Yes);
    return EXIT_SUCCESS;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文