开发者

function argument

开发者 https://www.devze.com 2023-04-08 08:49 出处:网络
What is the below highlighted code intended to do ? Why don\'t 开发者_JAVA百科we not use the arguments at all ?

What is the below highlighted code intended to do ? Why don't 开发者_JAVA百科we not use the arguments at all ?

int fun( int a, int b)
{
    (void) a; // <<<
    (void) b; // <<<

    printf("Hello World\n");
}


It's a way of preventing the compiler from warning about "unused parameters". It doesn't actually consume anything (the expression is discarded).

0

精彩评论

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