User Tools

Site Tools


cpp:interfaces

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
cpp:interfaces [2019/05/10 07:21]
gthanos
cpp:interfaces [2019/05/10 07:22]
gthanos
Line 50: Line 50:
   capacity = cap;   capacity = cap;
   stackSize = 0;   stackSize = 0;
-  array = new (nothrow) int[capacity];+  array = new int[capacity];
 } }
  
Line 59: Line 59:
 void ArrayStack::push(int o) { void ArrayStack::push(int o) {
   if(stackSize==capacity) {   if(stackSize==capacity) {
-    int *_array = new (nothrow) int[2*capacity];+    int *_array = new int[2*capacity];
     for(int i=0; i<stackSize; i++)     for(int i=0; i<stackSize; i++)
       _array[i] = array[i];       _array[i] = array[i];
Line 140: Line 140:
  
 void LinkedStack::push(int o) { void LinkedStack::push(int o) {
-  LinkedNode *node = new (nothrow) LinkedNode(head, o);+  LinkedNode *node = new LinkedNode(head, o);
   head = node;   head = node;
   stackSize++;   stackSize++;
cpp/interfaces.txt · Last modified: 2021/05/07 08:42 (external edit)