Re: Exemptions?
From: enki (enki034_at_yahoo.com)
Date: 01/30/05
- Next message: Alex Vinokur: "Re: Foo(300) = Foo(500); Why does a compiler compile that?"
- Previous message: Ivan Vecerina: "Re: Foo(300) = Foo(500); Why does a compiler compile that?"
- In reply to: Alf P. Steinbach: "Re: Exemptions?"
- Next in thread: Alf P. Steinbach: "Re: Exemptions?"
- Reply: Alf P. Steinbach: "Re: Exemptions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Jan 2005 01:59:28 -0800
I have been reading the posts and reading some. I am starting to
almost get it. I got a program to compile but not work well. I did
this program before I real all the replys. I see some mistakes but it
is starting to get better.
#include<iostream>
#include<string>
using namespace std;
struct error{
char *_msg;
error(char *msg){ _msg = msg;}
};
int main(){
int x;
while(x != 0){
cout<<"Number:";
try{
cin>>x;
}
catch(error e){
cout<<"Must be int!\n";
x = 0;
}
cout<<x<<"\n";
}
system("pause");
return 0;
}
- Next message: Alex Vinokur: "Re: Foo(300) = Foo(500); Why does a compiler compile that?"
- Previous message: Ivan Vecerina: "Re: Foo(300) = Foo(500); Why does a compiler compile that?"
- In reply to: Alf P. Steinbach: "Re: Exemptions?"
- Next in thread: Alf P. Steinbach: "Re: Exemptions?"
- Reply: Alf P. Steinbach: "Re: Exemptions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|