C ++“return”没有价值 [英] C++ "return" without value

查看:132
本文介绍了C ++“return”没有价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果没有回报价值,意思是什么?感谢

What is the meaning if there is no value of return? Thanks

void run_algo() {
    ...
    project(tolabel->second);
    ...
}

void project(Projected &projected) {
    unsigned int sup = support(projected);
    if(sup < minsup) // minsup is a global variable
        return;
    ...
}


推荐答案

因为你的函数类型是void,当你使用 return 时,它立即退出函数并返回调用者。

Since the type of your function is void, when you use return, it exits the function immediately and back to the caller.

这篇关于C ++“return”没有价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆