Note: This essay is directly referenced in the "C++primer (fourth Edition) Exercise solution (full version)". Here is mainly for the convenience of my repeated reading later.Exercise 1.18Write a program that prompts the user to enter two numbers and
One, the file naming rules.1, one class corresponds to one. h and one. cpp file, with the same file name as the class name, and the case is consistent.The exception class has a close relationship with other classes, or if other classes are only
Transferred from: http://www.360doc.com/content/09/0403/17/799_3011262.shtml1. the concept of templates. We have learned overload (overloading), for overloaded functions, the check mechanism of C + + can be different from the function parameter and
The inline functions is a C + + enhancement feature to increase the execution time of a program. Compiler replace the definition at compile time instead of referring function defination at runtime.Note-this is a suggestion to compiler to make the
Directory
Introduction of data type
Ii. Definition of variables
2.1. Name rules for variable names
2.2. Various forms of variable definition
Integral type (int)
Four, character type (char)
ObjectiveSometimes you want to pass a one-dimensional, two-dimensional array as an argument to the modulated function, what's special?Common parameters to do argumentsWhen the normal parameter is passed in, it is actually passed in a copy, and the
Note: This essay is directly referenced in the "C++primer (fourth Edition) Exercise solution (full version)". Here is mainly for the convenience of my repeated reading later.Exercise 1.12Compare the loops written in the previous two exercises. What
int example (int a){int b = 0;static int c = 3;b = B + 1; b = = 1, 1, 1c = c + 1; c = 4, 5, 6return (A+B+C); 7, 8, 8}Static variables are assigned the initial value at compile time, that is, the initial value is assigned only once, and it has an
STL Extraction LearningFirst, the Extraction template class implementationIterator class: A collection of common properties for templates, and other classes only need to integrate that class. This example includes only the Value_type attribute for
First define an enumeration //////Enumeration of custom attribute classes for annotations///PublicClassEnumdescriptionattribute:attribute {PrivateStringM_strdescription;Public Enumdescriptionattribute (StringStrprintername) {m_strdescription
/** 2 Features of inheritance:* 1, single-sex: A class can only inherit from a parent class, not more inheritance (everyone can only have a direct father)* 2, Transmission: Grandpa's will give Dad, Dad's will give son, son of will give grandson .....
In the. NET WinForm program, if the direct-start form is the main window, the main window cannot be closed because it maintains a Windows message loop that, once it is closed, declares the entire application to end, so the newly opened window is
There are three kinds of timer1, System.Windows.Forms.TimerThe main disadvantage of this application in WinForm is that the timing is imprecise and must have a message loop that the console application (console application) cannot useDrag the Timer
Generic typeGenerics introduce a concept: type parameters. By using type parameters (T) to reduce the risk of run-time casts or boxing operations, the most common use of generics is to create a collection class that can constrain the type of
ArrayList are very similar to arrays, others call it an array list, ArrayList can be dynamically maintainedTips:Like arrays, the data stored in ArrayList is called an element, and the number of elements ArrayList can hold is ArrayList capacity, with
24: print the calendar, 24 print the calendar24: print the calendar
View
Submit
Statistics
Question
Total time limit:
1000 ms
Memory limit:
65536kB
Description
Print the calendar table of the current
C ++ template learning: function templates and template functions, learning function templatesC ++ template: Functions and templates:
Common functions, function overloading, and template functions.
// All the shoes that have learned c must have
37: Table Tennis, 37 Table Tennis37: Table Tennis
View
Submit
Statistics
Question
Total time limit:
1000 ms
Memory limit:
65536kB
Description
The current Chairman of the IAAF, sarara, has been
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