简体   繁体   中英

How does the function work without any return type

this function works without any return type. But how that's my question....

 void factorial(int i_value){ int fact=1,j; for(int j=2*i_value-1;j>=1;j--){ fact=fact*j; } }

what are you want to return?
perhaps the fact

int factorial(int i_value){
    int fact=1,j;
    for(int j=2*i_value-1;j>=1;j--){
        fact=fact*j;
    }
    return fact;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM