Not long ago, in the C ++ program, we encountered a problem about the byte alignment of the struct.
I. Problem description
A struct is defined in the program as follows:Typedef struct{Char name [33];Int ID;Int age;} Person;
Declares an array of the
Yesterday, the customer asked to import data from the Excel file to the program. I was depressed and never touched the Excel file to import the data. So Google gave me a try, after about half an hour, I found two methods, one of which is Excel.. Net
In the past, VC6 always thought that it would not work to dynamically allocate an array of uncertain sizes. Now we can use vs2003.net to find it, for example:
# Include Using namespace std;Class stu{Public:Stu (int aa = 1, int bb = 2){A = aa;B = bb;}
I am used to writing try catch statements in JS, so I am blind in c ++ code .. Cup. I know little about c ++.
1. in C ++, many errors cannot be captured by try {} catch {}, such as null pointer access and wild pointer access. The program crashes
In the development of embedded systems, the main programming languages currently used are C and assembly. C ++ has a corresponding compiler, but it is still rarely used. In a relatively large range of embedded software, for example, operating
Just record your experiences;
C ++ has been around for a long time, but it has never been used since then. Therefore, many of C ++'s language features are superficial;
For example, I have always been confused: "Why do C ++ introduce references
Default constructor
If you define a class without defining the constructor for it. The compiler will provide the default constructor for this class. If you provide constructors, the compiler will no longer provide you with a default constructor. The
Value assignment operator
Built-in types can be directly assigned values, and classes should also define what will happen to assign values to objects of this type. Like the copy constructor, if the class does not define its own value assignment
/* This is the first time I wrote a technical blog. The code was pasted from a few days ago. I just started to learn the data structure and read a little c ++, so I want to use classes to implement linked lists.
*/
/*Date: 19/09/11Description: basic
Lib is required during compilation and is required during dll runtime. If you need to complete source code compilation, it is enough to have lib. If the dynamic connection program runs, it is enough to have a dll.
Generally, dynamic library
Original article: http://see.xidian.edu.cn/cpp/biancheng/view/51.htmlHeap memory
The storage space of the array must be applied before the program runs, that is, the size of the array must be a known constant expression before compilation. Too many
Generally, for common functions, it is impossible to protect members of the category class. To do so, you must make all the members of the class public (shared ), however, the problem is that any external function can access it without any
In C ++, the database status is very high.Basic Library
Boost "quasi" Standard Library
The boost library is a C ++ library that provides source code and serves as a backup for the standard library. Cross-platform. There is a
Part 5 advanced topics
[Chapter 1 tools for large programs]With exceptions, we can separate problem detection from problem resolution. The problem detection part throws an object to the processing code. Through the type and content of this object,
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