Getopt is used to parse command line option parameters.
# Include Extern char * optarg; // parameter pointer of the optionExtern int optind, // when getopt is called next time, check the option again from the position where optind is stored.Extern
Http://blog.csdn.net/knock/article/details/5511255
For debugging, you must understand how to print logs, so the following analysis is available.
We usually insert statements such as logd (..) and loge (..) in the program. But under what
As a built-in and most commonly used debugger, GDB is obviously irrefutable. Familiar with GDB is like all Linux developers suggest using vim, which is a "strange" plot.
Source code for testing.
#include int test(int a, int b){ int c = a + b;
Almost certainly, 80% of programmers have used cat programs. It is a command used in Linux to connect multiple files. It will be a good job to simulate and write such a small program, cat supports two methods: parameter and parameter-free,
If there
Recently, I saw someone using flash and the camera to make an interactive game. I thought it was very interesting. I used the library function of opencv and the VC model and made a similar haha. The effect is not very good. Next we will introduce
1. Compile libmad
1. Download the compressed package to your local computer and decompress it.
Tar-xvzf libmad-0.15.1b.tar.gz.-C ./
2. Go to the source code directory and configure
Compile a configuration file to the file content is as follows:
.
Sort command
Sort [Option] [input file]
Option:
-C: Check whether the file has been sorted. If not, output the first unsorted record.
-K specifies the sorting domain
-M merges two sorted files, and the merged files are also sorted, such as sort-M A1
The first structure type we will discuss is struct sockaddr, which is used to save socket information: Struct sockaddr {
Unsigned short sa_family;/* address family, af_xxx */
Char sa_data [14];/* 14-byte Protocol address */};
Sa_family is generally
There are two main methods:
One is to use GDB, and the other is to use valgrind.
1. Set the environment with ulimit-C Unlimited2. Run againProgram, Wait for segment fault, and the core file should be generated3. GDB core *
The output of
Linux Process CommunicationI. Overview of inter-process communicationProcess Communication has the following purposes:A. Data Transmission: A process needs to send its data to another process. The data volume sent is between one byte and several
52-Using the hash table APIZend The Hashtable-related APIs into several categories for us to find, and most of the return values for these APIs are constant success or failure.Create HashtableThe following describes the function prototypes using the
For C ++, function overloading exists, for example:
void CCNode::setScale(float scale)void CCNode::setScale(float scaleX,float scaleY)
The two functions have the same name, but different parameter tables. Finally, the function signature after
On the Windows platform, we typically use minidumpwritedump for stack dumps, which requires some understanding of the system APIs and some code writing. This paper summarizes a method that can record the process crash stack without coding, based on
The main function in C + + language, often with parameter argc, argv, is as follows:int main (int argc, char** argv)int main (int argc, char* argv[])//can also be wchar_t or TCHARARGC refers to the number of command line input parameters, argv
Sometimes the handcuffs accidentally to the chmod-R777/, this system is paralyzed ~ What should we do ?? First, you must prepare the same system as the faulty machine. for example, you can install a linux of the same version in the virtual machine
A word count program, completed by C + +, has the number of rows, the number of words, and the ability to complete the path of the file traversal.The code to traverse the file section is as follows:voidFindefile (wchar_t *Pfilepath)
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.