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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值