叠拓c语言面试题,叠拓C语言笔试题目.doc

时间: 2024-11-10 admin IT培训

叠拓c语言面试题,叠拓C语言笔试题目.doc

叠拓c语言面试题,叠拓C语言笔试题目.doc

叠拓C语言笔试题目

Name: Telephone No. :

Date:

Instructions

Please answer following questions in English, you can only use less than 60 minutes for this test

1. Preprocessor 10 points)

a) Please define a Macro by using preprocess instruction #define in 16-bit machine, the constant is used to indicate how many seconds in one year. (To ignore the leap year)

#define SEC_PER_YEAR (365*24*60*60UL)

(Note: If you define it to be (365*24*60*60)UL, you maybe find that it does not compile well.)

b) Please define a Macro, which is used to compare two parameters and return the smaller parameter.

#define MIN(a, b) ((a)<=(b)?(a):(b))

2. What is the problem of the below code (5 points)

#include

char* Func( void )

{

char p[10];

strcpy( p, "111" );

return p;

}

This function can not ret