cpp:exception
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
cpp:exception [2018/05/18 11:45] – created gthanos | cpp:exception [2018/05/18 11:47] – gthanos | ||
---|---|---|---|
Line 6: | Line 6: | ||
class Vector { | class Vector { | ||
int *array; | int *array; | ||
- | | + | int size; |
| | ||
public: | public: | ||
- | Vector(unsigned | + | Vector(int length=0); |
~Vector(); | ~Vector(); | ||
- | int & | + | int & |
}; | }; | ||
- | Vector:: | + | Vector:: |
size = length; | size = length; | ||
array = new (nothrow) int[size]; | array = new (nothrow) int[size]; | ||
Line 29: | Line 29: | ||
} | } | ||
- | int & | + | int & |
if(pos> | if(pos> | ||
cerr << " | cerr << " | ||
Line 56: | Line 56: | ||
class Vector { | class Vector { | ||
int *array; | int *array; | ||
- | | + | int size; |
| | ||
public: | public: | ||
- | Vector(unsigned | + | Vector(int length=0); |
~Vector(); | ~Vector(); | ||
- | int & | + | int & |
}; | }; | ||
- | Vector:: | + | Vector:: |
size = length; | size = length; | ||
array = new (nothrow) int[size]; | array = new (nothrow) int[size]; | ||
Line 75: | Line 75: | ||
} | } | ||
- | int & | + | int & |
if(pos> | if(pos> | ||
cerr << " | cerr << " |
cpp/exception.txt · Last modified: 2023/05/15 14:01 by gthanos