Log:
Évaluations - , GPA: ( )

Instructions HP, Modèle HP Integrity NonStop H-Series

Fabricant : HP
Taille : 755.99 kb
Nom Fichier :

Langue d'enseignement: enfrid

Le document est chargé, s'il vous plaît patienter
Le document est chargé, s'il vous plaît patienter


Par ce dispositif a également d'autres instructions :

Facilité d'utilisation


}
main(){
RWGStack(int) gs; //3
gs.push(new int(1)); //4
gs.push(new int(2)); //5
gs.push(new int(3)); //6
gs.push(new int(4)); //7
int aValue = 2; //8
if ( gs.contains(myTesterFunction, &aValue) ) //9
cout << "Yup.\n";
else
cout << "Nope.\n";

while(!gs.isEmpty())
delete gs.pop();
return 0;
}
Program Output:
Yup.
A description of each program line follows.
//1
This is the tester function. Note that the first argument is a pointer to the type of
objects in the collection, ints in this case. The second argument points to an object that
can be of any type_also an int in this example. Note that both arguments are declared
const pointers; in general, the tester function should not change the value of the
objects being pointed to.
//2
The second argument is converted from a const void* to a const int*, then
dereferenced. The result is a const int. This const int is compared to the dereferenced
first argument, which is also a const int. The net result is that this tester function
considers a match to occur when the two ints have the same values (i.e., they are
equal). Note that we could also choose to identify a particular int (i.e., test for
identity).
//3 -//7 These lines are the same as in the example in Chapter 12 (Example of Generic Collection
Classes). A generic stack of (pointers to) ints is declared and defined, then 4 values are
pushed onto it.
//8
This is the value (i.e., 2) that we will look for in the stack.


...

Ce manuel est également adapté pour les modèles :
Ordinateurs - HP Integrity NonStop J-Series (755.99 kb)
Ordinateurs - HP NonStop G-Series (755.99 kb)
Ordinateurs - HP NonStop L-Series (755.99 kb)

Écrivez votre propre critique du dispositif



Texte du message
Votre nom :
Entrez les deux chiffres :
capcha





catégories