C Language Knowledge Structure __c language

Source: Internet
Author: User
Tags mathematical functions first row

Four parts of C + +:
C language
Object-oriented C + +
Template C + +
Stl
Development environment and Class library:
Qt
Mfc
WxWidgets
Cocos2d (game engine) C language data types include basic types, constructed types, and pointer types. Basic types include numeric data and empty types (void). Numeric data includes shaping, character type, and floating-point types. Because the character type is represented by ASCII code, it is also a numeric type. Character types also include symbols and unsigned. Integral types include signed and unsigned. And all have integral (int), short integer (shorter), and long Integer. The integral type should pay attention to the overflow problem. Floating-point types should pay attention to precision and range of values. * floating-point types include single-precision (float), double, and long double precision (long double) *. Constructed type enumeration type (enum), array type (type[]), structural body type (struct), and common body type (union). Array types are of a single base type and are sequential precedence stores.
Sequential storage of arrays: Because the computer memory is one-dimensional, the elements of multidimensional arrays should be sorted into a linear sequence and stored in memory.
Row precedence: Arranges the array elements in row vectors, followed by the i+1 row vector immediately after the first line vector. Eg:a11a12a13...a1na21a22a23...a2n
In Pascal and C languages, arrays are stored in row precedence. row priority to be extended to multidimensional arrays, you can specify the first row of the bottom right subscript.
Column precedence: Arranges the array elements in column vectors, followed by the i+1 column vector immediately after the first column vector. Eg:a11a21a31...an1a12a22a32...an2
In Fortran, arrays are stored in the order of column precedence. column precedence is extended to multidimensional arrays, which can be defined as the leftmost subscript

Each data member in a struct type can be stored continuously, with different member types. The main member operators of the structural body are. and->. Where-> is used for pointers.

Common body type different data members occupy the same storage space.
4. Pointer type pointer is address. You can point to the base unit or to an array element, where the subscript and pointer methods can be used interchangeably. The maximum value of pointers is that they can directly manipulate the memory space, that is, dynamic allocation of space. Includes allocation space (malloc) and freeing space (free).
5. The operations in the C language include constants and variables. Where constants include symbolic constants (constants defined with #define) and literal constants (' a ', 25).variables include global variables and local variables according to their scope of action. Variables are divided into automatic variable (auto) register variable (register) static variables (static) and external variables (extern) According to storage type。 Type conversions in operations include automatic type conversions and coercion of type conversions.
6. C language China's functions are declared before they are defined and then called. Or it is first defined and then called. The first method of comparison is recommended. The return value of a function has two meanings: one is the return of the evaluation result, and the other is the whole return of the program flow. Functions include system functions, such as: Mathematical functions: cmath input and output functions: Cstdio time functions: CTime and random number functions: Cstdlib.
7. The input and output of the C language isbased on data flowInput and output. Includes formatted input and output (printf scanf format Controller), character (string) input and output (getchar,putchar,gets,puts), using file input and output, and stdio.h.
8. C language in the use of file input and output: Files include text files and binary files. The classification of operations for a file includes reading and writing and adding (a). The way files are operated includes random access and sequential access. The implementation of the file includes the caching system (advanced) and the non-caching system (low-level). Use files including open (fopen) files, read and write Files ((character (string) read/write: fgetc fputc fgets fputs) format read/write (fprintf fscanf) data block read and write (fread Fwrite is more suitable for binary file positioning (Rewind fseek ftell) file detection (feof whether to reach the end of the file ferror what happened to the file read)), closing the file (fclose) (you should develop the habit of closing all files before the program terminates, Data will be lost if you do not close the file. Because as mentioned earlier, write data to the file, is the first data to the buffer, the buffer is full after the official output to the file, if the data is not full buffer, and the program ended running, the buffer will be lost in the data, using the Fclose function to close the file, you can avoid this problem, It outputs the data in the buffer to the disk file before releasing the file pointer variable. )
9. C language equipment is the document.The operation of the keyboard, the monitor, and the operation of accessing files and transferring files over the network are Yi.。 A program is automatically called back when it is runningopen standard Input output file pointerIncludes stdin (standard input device), stdout (standard output device), and stderr (standard error-output device). Common devices include con (console), COMn (n can be 1,2,3, the keyboard on the computer), PNT (printer), which is equivalent to the filename.
10. Problem solving strategy: iterative, exhaustive, divide-and-conquer method (binary method), recursion, greed, backtracking, etc.
11. The algorithm accumulation has: asks the most value, the search, the sort, the Euclidean division asks the GCD, the transformation and the string processing and so on.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.