init21.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 37 行

C
37
字号
#include "fail.h"
#include <stdlib.h>
#include <string.h>

/* Test C99 style declarations */

int foo( int arg )
{
    ++arg;
    int a = 0;
    --arg;
    volatile int i = 4;
    ++arg;
    const char *s;

    for( int i = 2, j = 1; i < 10; ++i )
        a += i + j;     // i in scope opened by 'for'

    typedef int ynt;
    --arg;
    ynt y;
    ++arg;
    y = 3;
    struct { ynt a; } str = { 0 };
    --arg;
    enum { En = 3 };
    ++arg;
    
    return( a - i + En - y + str.a );    // back to the i in function scope
}

int main( void )
{
    if( foo( 1 ) != 48 ) fail( __LINE__ );
    _PASS;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?