1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > c语言里的英语大全 C语言面试题目汇总(国外英文资料).doc

c语言里的英语大全 C语言面试题目汇总(国外英文资料).doc

时间:2023-03-15 05:41:09

相关推荐

c语言里的英语大全 C语言面试题目汇总(国外英文资料).doc

C语言面试题目汇总(国外英文资料)

C语言面试题目汇总(国外英文资料)

Learn the embedded C language (1) from the interview question

Preprocessor (Preprocessor)

Use the preprocessor command # define to declare a constant that indicates how many seconds in a year (ignore the leap year problem)

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

Here are a few things I want to see:

; The basic knowledge of the # define syntax (for example: cannot end with a semicolon, the use of parentheses, etc.)

; Know the preprocessor will be for you to calculate the value of the constant expression, therefore, direct write you is how to calculate how many seconds in a year, not calculate the actual value, and is more clear and without cost.

; Realizing that this expression will overflow the integer number of a 16-bit machine - hence the long integer symbol, which tells the compiler that the constant is a long integer.

; If you use UL in your expressions, then you have a good starting point. Remember, first impressions are important.

Write a "standard" macro MIN, which inputs two parameters and returns a smaller one.

# define MIN (A, B) ((B)? (A) : (B)

This test is set for the following purposes:

; Identify the basic knowledge that # define applies in macros. This is important because until the embed (inline) operator becomes part of the standard C, macros are the only ones that facilitate the creation of embedded code

In the case of an embedded system, it is often necessary to embed code in order to achieve the desired performance.

; Knowledge of the triple conditional operator. The reason this operator exists in C is that it enables the compiler to produce more optimized code than if-then-else, which is important to understand.

; Understand that the parameters are enclosed in parentheses

; I also use this question to discuss the side effects of macros, such as: what happens when you write down the code?

= MIN = MIN = MIN = MIN (* p + +, b);

What is the purpose of the preprocessor identifier # error?

If you don't know the answer, see

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。