"Definition" and "declaration" of functions are not the same thing. The definition of function refers to the establishment of function function, including specifying function name, function value type, formal parameter and its type, function body,
compiler compiles a program, it compiles only one source file and generates the corresponding intermediate file (for the VC, the. obj file), and then the connector unifies all intermediate files to form an executable file. The problem is that when
Replace macros with inline:
1. Inline functions can be debugged at run time, while macro definitions are not possible;2. The compiler will do security checks or automatic type conversions (with normal functions) on the parameter types of the
The Declaration tells the compiler some information to assist the compiler in syntax analysis and avoid compiler errors. The definition is to tell the compiler to generate some code that will be used by the connector. That is, the Declaration is for
Recently in reading a book about C, the definition of function declaration and function is very vague, not clear, Baidu a bit, found a post written is very good, reproduced over:Original:"Define" and "declare" a function are not the same thing.
Man invented the programming language in order to control the machine. Computers are becoming more powerful, and programming languages are constantly being innovated. So I boldly believe that the meaning of programming language will be beyond the
development of function declarations
1 implicit function Declaration implicit function declarationThe main function and the printf function return value type int, if not declared, the compiler default function return value is the INT type C90
One.#define是C语言中提供的宏定义命令, the main purpose is to provide programmers with certain convenience in programming, and to a certain extent, improve the efficiency of the program, but students often do not understand the nature of the command in learning,
1 OverviewUsed preprocessing commands starting. For example, include the command # include and macro definition command # define. In the source program, these commands are placed outside the function, and are generally placed before the source file.
To write a good C language, a beautiful macro definition is very important. Macro definitions can help us prevent errors, improve code portability and readability, and more.In the software development process, there are often common or common
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.