I want to continue to write down, hope to continue!!!
In fact, feel I can not write down, feel the people here are good, I am a novice still installed force, a faint sadness!!!
I'll be writing a study diary.
C language Features: Simple language, can directly operate the underlying hardware, the implementation of high efficiency, written program portability, strong data processing ability, and direct access to memory address, C language is a face process language. (In fact, the language concise bar, feel almost, operation of the underlying hardware anyway, I have not seen, the teacher said when to show me again, feel good cock technology, when I can learn ah! The rest, I don't know yet, anyway. C language is composed of functions, functions are to implement a function of the code snippet, each function has its own function, a C language can be composed of a number of functions. C language entrance is a function called main (for short, the main function), a C program without the main function, then the program does not have the ability to run, a C program can only have a main function. Yesterday's "Cc-o renamed named. O" is a link that refers to one or more. o files that generate an executable file through the compiler, because in a project the program often requires more than one file, for example: "CC ONE.O two.o three.o", which will generate "a.out". Open it and execute it (you can also enter "./filename" in the terminal). One-line notes, some of which I transcription,??。
Some rules for
identifiers: Identifiers are some of the symbols and names that you customize in your program. The identifier can only be made up of 26 letters in uppercase and lowercase, 10 Arabic numerals "0-9", and an underscore "_". Naming rules for identifiers: is case-sensitive and cannot begin with a number. The C language provides special symbolic symbols that are not allowed to be defined, but we will use them frequently. Comments, comments, each code to write comments, after all, if the code is too many words, sometimes you can not remember, so adding comments is necessary. There are two types of annotations in C: single-line Comment: "//comment content" and multiline Comment: "/* inside the symbol on both sides is the content of the comment * *", when compiling the program, the comments will not be compiled into the binary file. (To tell you the truth, I'm sleepy when I write!) program is generally divided into static data and dynamic data, static data refers to permanent data, usually stored in the hard disk, Dynamic Data refers to the program in the process of operation, the temporary data generated, generally stored in memory.
The C language classifies the data (in fact Java and C are the same), the underlying data type is integer (int), float, and char (char), floating point with single-precision floating-point (float) and double-precision floating-point (double), empty type (void) and pointer type (void *) (thank you, I always thought the empty type and pointer type is the same ah ha), the final is the construction type: array, struct (struct), common body (union) and Enumeration (enum) (note: Anyway constructed type so far, I understand the array, the other useless, should speak of it!! )。 Constants: Represents some fixed data, but also the data that cannot be changed. Integer constants: "int", floating-point constant: "float and double", character constant: "char", string constant: "char[]" (Anyway, I accept that when the user enters the name). Variables: 1. A storage area of memory that has its own name (variable name) and type (data type), and the data stored in that zone can be modified. The data type variable name = initial value , and the C language provides the data types commonly used in 4: char, int, double, and float. Char: one byte; int: four bytes; float:4 bytes; Double:8 bytes. When you don't remember, you can use sizeof (char) to return the data type's consumption bytes (I did it anyway!). There are output format characters, this is completely different from Java! Integer: int,%d (note case, effect is not the same Oh!?) ; Long integer: long,%ld; character type: char,%c, float: float,%f, double: double,%f. The C language can be transferred from any basic type to another base type, with conversions divided into automatic conversions and casts. The same data types can be operated on, and when small types and large types are performed, the compiler automatically builds the small type into a large type. (want int converted double, want to let it automatically convert, anyway, I am directly to Double,int int to the error when some division, the difference is not a little bit, no Java automatic transformation of the smooth. The test time is very troublesome, of course, when it is used sublime text), there is a casting, forced conversion will have a loss of precision (generally, the conversion of double type to int type).
Continue yesterday's!!!