When we read the Gnu/linux kernel code, we encounter a special way to initialize the structure. This method is not introduced in some C textbooks (such as version anecdotes, K&r two). This approach is called specifying initialization (designated
0. Static modifier variables and functionsstatic modifier variable, 1) scoped, in this file. Global variables (custom, this file before the need for extern declaration), local variables function, 2) life cycle, the program has been saved during
Today I met a few good questions, and some of the previous pieces to write an article, as I delay to the study room an excuse for it.First, the first question.1 intFunChar*s) {2 Char* t =s;3 while(*t++);4 returnT-s;5 }6 the function of
The void type in C is actually a universal type, which means that our void can represent any type, that is, his range is wider than a specific type, for example:int *p = NULL;void *ptr = P; This is possible because the void * type contains an int *
Trinocular operatorThe trinocular operator: Also called the ternary operator. The symbol for this operator is:? :Grammar:Expression 1? Expression 2: Expression 3;Semantic:Execute expression 1, execute, the result of expression 1 if true, then
Whether in our development projects, or in our daily life, will be more involved in file compression. When it comes to file compression, someone may want to ask how the file compression is implemented, what the principle of implementation is, and
Reflection (Reflection) January 02, 2008 Wednesday 11:21
Two real-world examples:1, B Super: Everyone has done a physical examination of the B-Super bar, B-ultrasound can be detected through the belly of your internal organs of the
Recently some friends often ask me some questions, for example, how to convert a string into a Base64 string, how to convert a binary file into a Base64 file, and how to convert back to the original file, here I write the methodstring and Base64
Today, a colleague opens the CSH Command window and finds that it cannot enter any characters.Try a variety of methods, delete input method, restart the computer, change CSH version, are useless.The last time the system environment variable term is
C # Logging error logs (introduction, method Code)Introduction: The Program in error logging error log, can be conducive to maintenance, you can also record some of the procedures inside the operation and so on, it is very important, but alsoMethod 1
C + + defines the structure as follows and needs to be transformed into C #typedef struct TAGNET_DVR_CID_ALARM{DWORD dwsize;BYTE scidcode[cid_code_len/*4*/]; CID Event NumberBYTE sciddescribe[name_len/*32*/]; CID Event NameNET_DVR_TIME_EX
---restore content starts---A simple c-language implementation of the matrix multiplication program:This is the formula for matrix Multiplication:Source:1#include 2#include 3 #defineM 1004 5 intMainvoid)6 {7
1. Theconst object must be initialized because the value cannot be changed once it is Created. Eg:const int i = GetSize (); correct : run-time Initializationconst INT J = 42; correct: Compile-time Initializationj = 33; error: attempting to Write
Often see the following code:
#ifdef _cplusplusextern "C" {#endif#include "XXX.h"#ifdef _cplusplus}#endif
Explain:The purpose of extern "C" is to tell the C + + compiler that the following code compiles according to C, and
The rx-8025 is an off-chip i²c real-time clock, which is used in 9260 board methods as follows. The overall idea is to configure the kernel to add drivers (the I²c driver, the kernel has been provided very complete), board-level files to add devices,
Const in C/C ++, constin
1. the const object must be initialized because the value cannot be changed once created.
Eg:
Const int I = GetSize (); // correct: runtime Initialization
Const int j = 42; // correct: initialization at compilation
J = 33; //
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