The process of a request in the Struts2 framework is roughly divided into the following steps:

Source: Internet
Author: User

Print? //
// Main. cpp
// 6-2.cpp
//
// Created by JI Zilong on 13-4-10.
// Copyright (c) 2013 Ji Zilong. All rights reserved.
//
 
Class {
Private:
Int;
Public:
A () {a = 0 ;}
A (int aa) {a = aa;} // defines the constructor and uses the aa parameter to initialize data member.
};
Int main (){
A * p; // defines the pointer object p of Class.
P = new A (3); // use p to point to A dynamic object and initialize it as an integer.
}
2:
//
// Main. cpp
// 6_2_2.cpp
//
// Created by JI Zilong on 13-4-10.
// Copyright (c) 2013 Ji Zilong. All rights reserved.
//
# Include <iostream. h>
# Include <stdlib. h>
Class {
Private:
Int *;
Int n;
Int MaxLen;
Public:
A (): a (0), n (0), MaxLen (0 ){}
A (int * aa, int nn, int MM );
~ A ();
Int GetValue (int I) {return a [I];} // returns the value of a [I] In the function body.
};
A: A (int * aa, int nn, int MM ){
N = nn;
MaxLen = MM;
If (n> MaxLen) exit (1 );
A = new int [MaxLen];
For (int I = 0; I <n; I ++ ){
A [I] = aa [I];
}; // Transmits each element value in the aa array to the corresponding element of array a using I as the cyclic variable
}
A ::~ A () {delete [] a;} // class definition of the destructor, releasing the space pointed to by pointer data
Int main ()
{
Int B [10] = {1, 2, 4, 5, 6, 7, 8, 9, 10 };
A r (B, 10, 10 );
Int I, s = 0;
For (I = 0; I <10; I ++ ){
S = s + r. GetValue (I );
}; // Use I as the cyclic variable to accumulate the values of each element in the data member of the r object to s.
Cout <"s =" <s <endl;
}
Running result:

//
// Main. cpp
// 6-2.cpp
//
// Created by JI Zilong on 13-4-10.
// Copyright (c) 2013 Ji Zilong. All rights reserved.
//

Class {
Private:
Int;
Public:
A () {a = 0 ;}
A (int aa) {a = aa;} // defines the constructor and uses the aa parameter to initialize data member.
};
Int main (){
A * p; // defines the pointer object p of Class.
P = new A (3); // use p to point to A dynamic object and initialize it as an integer.
}
2:
//
// Main. cpp
// 6_2_2.cpp
//
// Created by JI Zilong on 13-4-10.
// Copyright (c) 2013 Ji Zilong. All rights reserved.
//
# Include <iostream. h>
# Include <stdlib. h>
Class {
Private:
Int *;
Int n;
Int MaxLen;
Public:
A (): a (0), n (0), MaxLen (0 ){}
A (int * aa, int nn, int MM );
~ A ();
Int GetValue (int I) {return a [I];} // returns the value of a [I] In the function body.
};
A: A (int * aa, int nn, int MM ){
N = nn;
MaxLen = MM;
If (n> MaxLen) exit (1 );
A = new int [MaxLen];
For (int I = 0; I <n; I ++ ){
A [I] = aa [I];
}; // Transmits each element value in the aa array to the corresponding element of array a using I as the cyclic variable
}
A ::~ A () {delete [] a;} // class definition of the destructor, releasing the space pointed to by pointer data
Int main ()
{
Int B [10] = {1, 2, 4, 5, 6, 7, 8, 9, 10 };
A r (B, 10, 10 );
Int I, s = 0;
For (I = 0; I <10; I ++ ){
S = s + r. GetValue (I );
}; // Use I as the cyclic variable to accumulate the values of each element in the data member of the r object to s.
Cout <"s =" <s <endl;
}
Running result:


 


Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.