C language basic question 1. Structured encoding: The use of the If else while, and so on control structures. Modular Design: This function is divided into several sub-modules such as functions. 2. The methods and steps to solve the problem are called algorithms. Good algorithm requirements: correctness, robustness, readability, efficiency and low storage rate. 3. Characteristics of the algorithm: poor, deterministic, there are 0 or more inputs, there is one or more outputs, validity. 4. Three basic structures: order, select, Cycle. 5. Until the type loop is the end loop when the expression value is true. Do-while is not until the type loop, it is a typical type of loop, and when the condition is established, executes or continues execution of the statement in do. 6. SizeOf gets the character occupancy space that contains the strlen array or pointer, read to, and does not include. 7. {} is a conforming statement and no more semicolons are added at the end of the statement. The statements within {} should be separated by semicolons, which can be defined internally, which is the variable of the block, which is only valid for 8 in this program block (that is, the curly brace). Ellipse start and end frame Diamond judge parallelogram input output Rectangle processing 9. Priority issues 1 parentheses Operator "()", address Operator "[]", struct member application means ",", "." 2 Non-! , bitwise counter ~, + + 、--、 negative, *, &, sizeof, (type conversion) 3*/% 4+-5 Move << >> 6 relational operators >, >=, <, <= 7==,! = 8& 9^ 10 | 11&& 12| | 13 bar Operator "?:" 11 assignment operator 12 Comma 10. Bitwise AND & Functions 1. Clear 2. Take a number of the specified bits 3. Reserved for special positioning. 11. Bitwise OR | Function 1. Set 112. Xor ^ The same is 0 XOR is 1. Function 1. Special positioning Rollover 2. Retain the original value 3. Swap two values without the TEMP variable a=a^b;b=b^a;a=a^b;13. Take the inverse ~ left shift <<: only applicable to the left side of the overflow part of the case does not contain 1. Can be used as a multiplication operation, multiply 2^n left n bits. Shift Right >> divide by 2, right shift n is equivalent to dividing by 2^N14. FPUTC (CH,FP); Write character for (; (CH=FGETC (FP))!=eof; ) Read character ASCII file end flag Eof,!fEOF (input) indicates that the source file (for input) is not closed. Fputs (string, file pointer); Outputs a string fgets (pointer, string length +1, file pointer) to the specified file; Reads a string from the file fread (void *buffer,int size,int count,file *fp), starts at the current position of the file pointed to by the FP, reads in size bytes at a time, repeats count times, The read-in data is stored in memory starting at buffer and the read-write position pointer is moved forward size* count bytes. FSCANF (file pointer, "format character", input variable first address table); int fprintf (file pointer, "format character", output parameter table); FSCANF (file pointer, "format character", input variable first address table); int fprintf (file pointer, "format character", output parameter table); Rewind (file pointer); The position pointer of the file is returned to the file header. 15.1. When reading/writing 1 characters (or bytes) of data: Select the Fgetc () and FPUTC () functions. 2. When reading/writing 1 strings: Select the Fgets () and fputs () functions. 3. When reading/writing 1 (or more) non-formatted data: Select the Fread () and fwrite () functions (this function is the most frequently used, and the access function for larger problems). 4. When reading/writing 1 (or more) formatted data: Select the FSCANF () and fprintf () functions.
The basic problem of C language Common test