why do you have }; closing off your first function? fix that and it might help. 
:)
I didn't try the code, that was just what I noticed on first glance. Also, if O 
isn't a variable, it needs to be enclosed, 'o'


Thanks,
Tyler Littlefield
email: [EMAIL PROTECTED]
web: tysdomain-com
Visit for quality software and web design.
skype: st8amnd2005

  ----- Original Message ----- 
  From: prakashshukla 
  To: [email protected] 
  Sent: Sunday, November 09, 2008 7:52 AM
  Subject: [c-prog] try catch


  #include<iostream.h>
  I am experimenting with the following program for error handling. I 
  get an error on the word try as "unrecognized word". Pl help

  #include<conio.h>
  void test(int i)
  {
  try
  {if(i!=0) throw i;
  else throw "Zero";}
  catch(int a)
  {cout<<"Caught an int"<<a<<endl;}
  catch(char *s)
  { cout<<"Caught a string"<<s<<endl;}
  };
  void main()
  {
  clrscr();
  test(1);
  test(23);
  test(O);
  getch();
  }



   

[Non-text portions of this message have been removed]

Reply via email to