开发者

Can we call a function inside a routine where the function return data type is void?

开发者 https://www.devze.com 2023-01-15 05:37 出处:网络
For example, I have: void(temperature, pressure,time) { int i; double results[10]; for (i = 0 ; i <= 9 ; i++)

For example, I have:

void(temperature, pressure,time)
{
    int i;
    double results[10];

    for (i = 0 ; i <= 9 ; i++)  
    {
        fx(temperature, pressure, time);
        results[i]=fx[i];
    }
}

(P/S: above is the simplified version of my real problem) fx by itself is of course another ste of codes with equations for calculations that will give results in fx[i].

I was just wondering if I can call another function like that in a开发者_运维百科 'void' function. Just a curious question, Thanks!


Yes you can, as long as you give the outer function a name. (This is C, or similar, right?)


Yes you can, and I am really curious to know why you have this question in your mind because I cannot think of any reason.

0

精彩评论

暂无评论...
验证码 换一张
取 消