Huawei's pen test (2004-7-24 from smth)

zhaozj2021-02-16  97

Facing the wrong

Void test1 ()

{

Char string [10];

CHAR * STR1 = "0123456789";

STRCPY (String, Str1);

}

Void test2 ()

{

Char String [10], STR1 [10];

For (i = 0; i <10; i )

{

STR1 [I] = 'a';

}

STRCPY (String, Str1);

}

Void Test3 (char * str1)

{

Char string [10];

IF (strlen (str1) <= 10)

{

STRCPY (String, Str1);

}

}

2. Facing the wrong

#define max_srm 256

DSN GET_SRM_NO ()

{

Static int SRM_NO;

INT I;

For (i = 0; i

{

SRM_NO% = Max_Srm;

IF (my_srm.state == idle)

{

Break;

}

}

IF (i> = max_srm)

Return (NULL_SRM);

Else

Return SRM_NO;

}

3. Write the program operation results

Int Sum (INT A)

{

Auto int C = 0;

Static int b = 3;

C = 1;

B = 2;

RETURN (A B C);

}

void main ()

{

INT I;

INT A = 2;

For (i = 0; i <5; i )

{

Printf ("% D,", sum (a));

}

}

4.

Int Func (INT A)

{

INT B;

Switch (a)

{

Case 1: 30;

Case 2: 20;

Case 3: 16;

DEFAULT: 0

}

Return B;

}

Butc (1) =?

5:

Int a [3];

A [0] = 0; A [1] = 1; A [2] = 2;

INT * P, * Q;

P = a;

Q = & a [2];

Is A [q -p] =?

6.

Define int ** a [3] [4], the memory space occupied by the variable is: _____

7.

Write a function, ask for an annual month-day day or second, output the next second of the month. If you enter 23:59, 23:00, 59 seconds, 2004, the output is 0:04 0:00 on January 1, 2005.

转载请注明原文地址:https://www.9cbs.com/read-13606.html

New Post(0)