历史
鱼菜小说网 > 其他类型 > 你也能拿高薪: 名企面试自助手册 > 39. 全球第三、欧洲第一的大半导体企业

39. 全球第三、欧洲第一的大半导体企业(2/2)

nt *p)

    {...........}

    ..........

    main()

    {

    int num=0;

    .........

    func(&num);

    ........

    }

    ..........

    Here, the function argument “&num” is passed  .

    a. by value b. by reference

    III. Practice

    Create a tree, which has h (h>0) layers, and its each node has w (w>0) sub-nodes.

    Pleaseplete the following iplete solution.

    #include

    #include

    struct tree{

    char info;

    p_sub; //link to sub-nodes

    };

    // allocate memory and initiate

    void dnode ( struct tree* tmp )

    {

    =malloc( sizeof (struct tree) );

    = 0x41;

    = NULL;

    }

    struct tree *dtree (struct tree* subtree, int height, int width)

    {

    int i;

    if ( !subtree )  //if necessary, allocte memory for subtree

    denode(subtree);

    if ( height == 1 )

    return subtree;

    else if ( height == 2 ) {

    struct tree *leaf = NULL;

    for ( i=0; i