This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
|
cpp:exception [2022/05/23 03:52] gthanos |
cpp:exception [2023/05/15 13:58] gthanos |
||
|---|---|---|---|
| Line 46: | Line 46: | ||
| </ | </ | ||
| - | Αν και η παραπάνω διαδικασία δεν είναι λανθασμένη, | + | Αν και η παραπάνω διαδικασία δεν είναι λανθασμένη, |
| <code cpp VectorUse.cpp> | <code cpp VectorUse.cpp> | ||
| 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< | + | |
| } | } | ||
| </ | </ | ||