12.1 Storage Class
Storage Period: the time when the variable is stored in the memory. The scope and link of the variable indicate which parts of the program can use the variable name.Different storage classes provide variable scopes, links, and
[Cpp] # include int main (void) {int I = 2147483647; unsigned int j = 4294967295; printf ("% d * % d ** % d \ n", I, I + 1, I + 2); printf ("% u * % u ** % u \ n", I, I + 1, I + 2 ); printf ("% d * % d ** % d \ n", j, j + 1, j + 2 ); printf ("% u *
Chapter 10 objects and Classes
Mountains and waters finally come to the front of the class. This chapter begins and will finally be in touch with the class at zero distance.
OOPHow designers think
When using procedural programming methods,
I heard an example about inline in the class about the efficiency of inline function execution. After class, I wrote a record based on my memories. It can be seen that the execution efficiency of inline functions is indeed higher than that of common
1. Nature of OOP
Design and extend your own data types.
2. c ++ naming rules:
1. Only letters, numbers, and underscores (_) are allowed ).
2. The first character cannot be a number.
3. Case Sensitive
4. names with two underscores (_) or underscores (
Programming exercises
1. Write a C ++ program that displays your name and address.
// file-name: 2-7-1.cpp// Description: Display your name and address#include int main(void){ using namespace std; cout
2. Write a C ++ program that asks for a
1. Write a program that requires the user to enter two integers, and the giant program calculates and outputs the and output of all integers (including these two integers) between the two integers. This assumes that you first enter a smaller integer,
bank is the realization of the fifth question, BANK1 is the implementation of the sixth question
#ifndef queue_h_ #define Queue_h_ class Customer {private:int arrive;
int processtime;
Public:customer () {arrive=processtime=0;}
void set (int
#ifndef cd_h_ #define Cd_h_ struct Strandlen {char *ch;
int Len;
};
Base class class cd{//represents a Cd disk private:strandlen performers;
Strandlen label; int Selections;//number of selections double playtime;//playing time in minutes
This chapter is very basic, simple, too weak chicken is not much to say. Just be rude. Start with a new empty project in vs2012 and output Hello,world .Briefly release the program:#include //preprocessing compiler directives #include add the
1: indicates that the compiler contains all information in the stdio. h file.2. parentheses indicate that main () is a function name. int indicates that the function returns an integer. void indicates that the function does not accept any parameters.
11.1 string representation and string I/O
A string is a char array ending with an empty character (\ 0.
11.1.1 Initialization
I. string constants
A String constant, also known as string text, refers to any character in a pair of double quotation
1. C language refreshes the output buffer in three cases: the buffer zone is full, and line breaks and inputs are encountered.
2. in C language, the compiler can select which parameter value in the function is calculated first, which improves the
1. Increment and decrease Operators
Do not use multiple incremental and decreasing operations on the same value for the same statement.
For example, x = 2 * x ++ * (3-++ X );Different results will be generated in different operating systems (the
8.1 single character I/O: getchar () and putchar () 8.2 Buffer
When you run the preceding program On some systems, the text you entered is immediately displayed. However, in most systems, nothing happens until you press the Enter key.The immediate
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.