Thread View: be.comp.programming
1 messages
1 total messages
Started by Manchiu
Fri, 25 May 2007 12:43
Excepties C++
Author: Manchiu
Date: Fri, 25 May 2007 12:43
Date: Fri, 25 May 2007 12:43
32 lines
1413 bytes
1413 bytes
Wordt er hier altijd uitgegooid door Windows met ingave negatief getal, hoe
komt dit??
#include <iostream>
using namespace std;
int main()
{
int li_getal;
try
{
cout << "Geef een getal in > 0: ";
cin >> li_getal;
}
catch(int)
{
cerr << "Is kleiner dan 0" << endl;
}
if(li_getal<0)
{
throw 1;
}
return 0;
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads