C language to determine whether the variable name is legal:
Code:
# Include # include # include int main () { int N, I, flag, Len, flag1; char * ss [] = {"Auto", "break", "case", "char", "const", "continue", "default ", "do",
Today, I saw a video on csdn explaining C #3.0. Although the speaker students a bit, I insisted on listening. There is a sentence in it that aroused my interest. If the structure is the same, we can strongly convert an anonymous type. It seems that
Sorted out some scattered topics in the Forum.ArticleNot complete. We will update and improve the details gradually in the future. For example, if you find that the Forum is a good article or your own previous good articlesCode, Can be
1. ysb_hw
1. Relationship between define usage and typedef and inline.
See another articleArticle.
2. Implement the definition and basic implementation of stack classes. (constructor, destructor, push, pop)
3. count the number of occurrences
Usage of "pointer" in C ++
Source: http://blog.chinaunix.net/space.php? Uid = 20498030 & Do = Blog & cuid = 274854Many people are learning C ++, but they are very confused about the pointer in C ++. I will share it with you.
The system uses the
4. How does the pointer Parameter Pass the memory?
If the function parameter is a pointer, do not expect this pointer to apply for dynamic memory. In Example 7-4-1, the getmemory (STR, 200) Statement of the test function does not enable STR to
Problem
The following is not allowed:Switch ()
{
Case 1:
Int A = 6;
// Stuff
Break;
Case 2:// StuffBreak;}
The following is allowed:Switch ()
{
Case 1:
{
Int A = 6;
// Stuff
}
Break;
Case 2:// StuffBreak;}
A piece of code from the actual project
References and pointer parameters, both of which allow the function to modify the real parameters, and allow the function to effectively pass large class objects. So how can we declare a function parameter as a reference or a pointer?
The reference
I. Container Vector
When using vector, the header file must be included. :
# Include
Type vector is a template defined in namespace STD:
template >
The second parameter defines the memory model. We generally use the default memory model.
Ii.
The C ++ STL container deque is similar to the vector and uses dynamic arrays to manage elements.
Before using deque, you must include the header file:
# Include
It is a class template defined in the namespace STD:
Template Class _ AX = Allocator
[1] (page94) code:
Int staff_size = 27; // error: Non-const Variable double salaries [staff_size];
But the compiler does not report an error? Why?
Answer:
It can be compiled with Dev C ++, but an error is reported using vs2008. It seems that the
Forced conversion in C ++
1. Forced conversion of Old Styles
The forced transformation of C-style is as follows:
(T) exdivssion // cast exdivssion to be of type T
Function-style forces the transformation to use the following syntax:
T (exdivssion) //
/* Simulate the LS command to implement the parameter-tarirl. some code is repeated, which can be improved by adding parameters on the basis of the program. The program idea is clear and easy to expand */# include # include # include # include #
Document directory
Virtual function table
General inheritance (no virtual function overwrite)
General inheritance (with virtual function overwrite)
Multi-inheritance (no virtual function overwrite)
Multiple inheritance (with virtual function
Exception thrown by the constructor
1. the constructor defined in standard C ++ is a place where an object builds itself and allocates the required resources. Once the constructor is executed, it indicates that this object has been created, it has
(Network Abstract)Protocol in objc is equivalent to the Java interface, and delagate is the implementation class of the interface (callback in C is similar );The data source means that the object follows the data storage protocol and can store and
This article is based on some posts, materials, and documents on the Internet.
Object-Oriented Design Patterns
We should be familiar with the object-oriented design model.
In the 23 design patterns, singleton and factoryMethod. Of course, This
Overview of C/C ++ header filesC. Traditional C ++
# Include // set the insertion point# Include // Character Processing# Include // defines error codes.# Include // floating point number processing# Include // file input/output# Include //
Different from general software programming, embedded system programming is built on a specific hardware platform, which requires strong hardware direct operation capabilities. Undoubtedly, assembly language has such characteristics. However, due to
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