cpp:exception
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
cpp:exception [2023/05/15 13:57] – gthanos | cpp:exception [2023/05/15 13:58] – gthanos | ||
---|---|---|---|
Line 109: | Line 109: | ||
int main() { | int main() { | ||
int size; | int size; | ||
- | | + | |
- | cout << "Enter verctor size: "; | + | cout << "Enter verctor size: "; |
- | cin >> size; | + | cin >> size; |
- | try { | + | try { |
- | Vector v(size); | + | Vector v(size); |
- | } catch(std:: | + | } catch(std:: |
- | if(size< | + | if(size< |
- | cout << " | + | cout << " |
- | continue; | + | continue; |
- | } | + | |
- | exit(-1); | + | |
} | } | ||
- | | + | |
- | v.valueAt(i) = 100-1; | + | } |
- | } while(size< | + | |
} | } | ||
</ | </ |
cpp/exception.txt · Last modified: 2023/05/15 14:01 by gthanos