These days, I participated in the ZTE's monthly support competition and used the standard I/O Library of C language. Some of the details are not very clear, which leads to many bugs and takes a long time to debug. So take a note here for future
When to use a virtual destructor
Class Base{Public:Base ();~ Base ();...};
Class Derived: public Base{...};
Base * p = new Derived;Delete p;
In this example, if the base class pointer p points to the object of the derived class, releasing the
When I took the test, I encountered a question about const, which is roughly as follows:
The following code is provided to check whether the code can be compiled, run, and run.
[Cpp]Const int a = 1; Int * B = (int *) &; * B = 31;
The above code
The computer uses storage units to store data (encoded data). variables are used in the C language to identify the storage units in the computer.
The C language contains long I, j; I = 1; j =-1;, then the corresponding computer has four bytes of
Object C Memory ManagementI. Basic concepts:
1. the Objective-C memory management mechanism in the iPhone system is flexible, that is, it can be used like C/C ++, you can also add an AutoreleasePool to upgrade it to a semi-automated memory
C language library function name: introduction function prototype: size_t fread (void * buffer, size_t size, size_tcount, FILE * stream); Function Ability: read data from a FILE stream, read count elements, each element size byte. if the call is
Program Introduction: Sometimes we want to know which tables are in a database and what fields are in the table. I wrote a small program to implement this function. Idea: 1: connect to the database (nonsense) 2: Get all the tables in the database
Question: give you a bunch of data so that you can go from top to bottom and take the longest path to the bottom. Practice: go up and down. Dp [I] [j] + = max (dp [I + 1] [j], dp [I + 1] [j + 1]) [html] # include # include # include using
There are very few courses in the university that focus on the domain or even bit operators. In fact, bit operations may play a key role in algorithm optimization. & Bitwise AND | bitwise OR ^ bitwise OR ~ Bitwise inversion shifts right are six
This program uses the ICMPv4 protocol (echo request) to test whether the network from the local machine to a server is connected. Because the original socket is used, administrator permissions are required to run the program. PS: This program
[Plain]/* Start the comments in the program header (to avoid any problems encountered during the submission of blog posts, the slash used to indicate that the comments have been deleted)* Copyright and version Declaration of the program* All rights
[Plain] Description Search for Series 1 2 4 7 11 16 22 ...... The sum of the First n. Input There are multiple groups of input data, each of which occupies one row. The input data is an integer of n, 0 Output Each group outputs a row and each
Print? Description A "text return string" is a string with the same reading and deserialization. For example, "level" or "noon" is a text return string. Write a program to check whether the read string is a "reply ". Input The input contains
[Plain] # include # Include # Include Float calculate_perimeter (float x, float y, float z );Float calculate_area (float x, float y, float z );Int judge_triangle (float x, float y, float z );Int judge_righttriangle (float x, float y, float z );Int
[Plain]# Include Int main (){Int year;Int I;Int a [1000]; While (scanf ("% d", & year )! = EOF & year! = 0){A [0] = 1; // The first yearA [1] = 2; // The second yearA [2] = 3; // The third yearA [3] = 4; // year 4 For (I = 3; I {A [I] = a [I-1] + a
In Windows, we can use the ipconfig command to obtain information about the NIC. in Linux, the command is ifconfig.
The information we can obtain is richer, including the traffic received and sent by the network card. It is not easy to use the C
Simple programs can be implemented through commands
[Plain]# Time./test Real 0m2. 033 sUser 0m2. 032 sSys 0m0. 000 s
# Time./test
Real 0m2. 033 sUser 0m2. 032 sSys 0m0. 000 s
If the time command is not convenient, you can use system functions.
[Cpp]#
# Include # include # include # include # define N 100/* stores the student status information of 100 students */int flag;/* Indicates whether to log on */struct date/* date of birth */{int year; int month; int day;}; struct student {char num [20
Memory occupied by a C/C ++ compiled program is divided into the following parts:1. program code area (. text)-stores the binary code of the function body.2. In the text Constant Area (. rodata), the constant string is placed here. After the program
In C, side effect refers to the modification of data objects or files. For example, the following statement var = 99;The side effect is to change the var value to 99. Evaluate the expression may also produce side effects, such:Se = 1, 100The side
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