Three words two words C ++

xiaoxiao2021-03-06  40

One. Background: Because I have to figure out a more interesting program written with ATL, I am currently c (I can't be considered eager to learn, but I have never been in-depth, but I have used three, four days, I have seen some of C . Ontario, the desire to create, so there is this article, more importantly, I have read the Waiti's sentence "published the best memory". Reference: a) Tsinghua Publishing House - "C Language Design" 1999 B) Master - "Learning Visual C 24" C) "21 Days Study C ": A good e-book D) Songgang Publisher: "High C Language". Note: Tsinghua version of "C language design" is a college tutorial, language brief, boring, but a good textbook, the college is heavy, see this mainly used for memory. "21 days to learn C " is a language vivid, rich in C textbook, I don't know which day I get from the Internet, it is a fate, I have a question I don't understand, I am here. I understand, but the source code is not fine, so it is so fast! In order to have a comparison with C, I will put the "higher C language" before I've seen. Also, you have to have a good translation software, because some key words are not intended, you can check your origin and origin, there is a good help to your understanding, it is recommended to use "Jinshan Words". For example: the meaning of prototype, if you don't understand, check: an Original Type, Form, or Instance That Serves AS A Model on Which Later Stages Are Based or Judged. (Prototype A original type, The form or illustration is a model of the basis of its later stage). If you refer to a compilation principle, you will know how exact this word! About the "learning of Visual C 24 hours" is mainly an editor that is familiar with VC and how to use MFC (I have finished using all the examples of this book). four. Text: Ok, the words come forward! I use three words and two words C , Ready! Go, please note: If you can't see it, don't barely, you can try the above way to learn C chapter 1: C is a advanced in C, C can run through higher language And low-class language chapter 2: Function 1. Piped 5. Address: & P 3. Array Automatic Pointer function protest: prototype English also mean, before calling, you can make C compiler to have a probably Learn. The function declaration is a prototype of the function, and the function defines the first row of the function body.

Function declaration does not require special instructions, such as int comparea (int, int) // prototype function parameter table, not explained as empty parameters (VOID) such as CompareA () equivalent to comparea (Void) type conversion: x = FLOAT) I // CX = float (i) // C , More Like a Function Macro: Minimize the use #define as shown below #define doub (x) x * 2 and Doub (1 2) is understood as (1 2 ) * 2, but according to 1 2 * 2 return value is 5 // error alternative to inline function is defined as: inline func (parameter), disadvantage: The structure is not easy to read, more importantly, if the function is too large, The compiler can be ignored to use as little as possible, often predefined identifiers: char cdata [] = _date_; // define data char ctime [] = _time_; // define Time function parameter delivery: There are three ways: 1 value ( Press the copy), low efficiency, does not change the original value 2 Press the address (pointer), it is not recommended, change the original value, the efficiency is 3, according to the reference: Replace the second method, because the principle is automatically indirect Quote; change the original value, efficiency INT FUC (int & i) {i = i // does not need to use * i, simple} ** If you want to guarantee the efficiency, do not change the original value, available in Const Left Value Reference Example: FUNC1 (4, 6) = 0; INT & FUNC1 (INT & C, INT & F) {RETURN (C> f)? C: f} Default Parameters: Stax (Float TaxRate = 0.7); // Write out in the prototype instead of the overload in the definition statement: C is managing the same function name through Name-Mangling technology, also known as the name of the court, if you want to use C's functions Is there any statement extern "C" Void Func1 () overload function: operator overload: is a centralized performance pointer to the ability of C to abandon microwave details: Use * P definition of pointer variables, & p to correct the address of the pointer, virtual function: To know the concept of virtual functions, you must know the concept of dynamic edience (bind), which is relative to static compaction, which is called when calling, which belongs to the polymorphic static compaction. When the call function, the function is already in memory. Location, Dynamic is different, when the function is called, when the function is called, it is just a pointer to the function.

转载请注明原文地址:https://www.9cbs.com/read-59592.html

New Post(0)