Chapter 02 Data Abstraction
2.1 Declaration and Definition
[Statement and Definition]
Declaration: Introduce the name to the computer. Definition: Assign the storage space for the name
[C declaration and definition]
Definitions and declarations can appear simultaneously, such as variable declarations: int ncount. Traditional C declarations often use extern keywords, especially variables; functions do not need to use
[Function prototype]
Function prototype: About parameter type and return worth all information, C requirements must write function prototype, remember the previous mention, it needs to increase many security restrictions [C function declaration and definition]
. Function prototype (declaration): You can have only parameter types, that is, only a case. Function definition: must have a parameter name, that is
〖Personal understanding〗
In fact, I usually don't pay attention to the statement and definition of the function. When I first started to learn VC, the function's statement and empty definitions were automatically implemented; and I like to use the class view, and my colleague is used to using the file view, Time I also start like to use the file view, because it is discovered to declare and implement habits, because even if the function declaration and implementation of the wizard production, the software development of the installation specification is still needed to add some instructions for our description:
/ / / Function Name: xxx // Function Description: xxx // Parameter Description: // [In | OUT | INOUT] Parameter Name Description // Return Description: // Return value // Modify variable: Global variables involved and Member variable // modified log: /
This will be very clear and convenient in the future code maintenance. For the programmers of the future maintenance procedure, I remember "communication" in the first chapter, the document is the external principle left to the next person. The clues, code and their description are the clues of the internal principles. And often illustrate and code content 1: 1.