Vērtējums:
Publicēts: 02.04.2004.
Valoda: Angļu
Līmenis: Vidusskolas
Literatūras saraksts: Nav
Atsauces: Nav
  • Paraugs 'Stacks in C++ ', 1.
  • Paraugs 'Stacks in C++ ', 2.
  • Paraugs 'Stacks in C++ ', 3.
  • Paraugs 'Stacks in C++ ', 4.
  • Paraugs 'Stacks in C++ ', 5.
  • Paraugs 'Stacks in C++ ', 6.
Darba fragmentsAizvērt

//variables
int value;
//asking for value
cout << "nnEnter value to push : ";
cin >> value;
//new node decleration
stack_node *new_node;
// Allocate memory for the new node.
new_node = new stack_node;
/*I have seen some processors specially AMD chipsets
sometimes gives error for basic stack dynamic programming,
also sometime we get system error due to the status of the
RAM, By looking at this posibility i include this error here */
if(new_node == NULL)
{
// If memory allocation problem, set error
// status and proceed to exit the function.

Autora komentārsAtvērt
Atlants