pls. urgent..urgent..urgent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anushhprabu
    New Member
    • Sep 2006
    • 43

    pls. urgent..urgent..urgent

    Code:
    int _isBrace_(char c)
    	{
    		if(c=='(' || c==')') return 1;
    		throw "Error in Input";
    
    	}
    can i write like this to throw an user defined exception..
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Originally posted by anushhprabu
    can i write like this to throw an user defined exception..
    Yes but I would have though this function would be better written as

    Code:
    int _isBrace_(char c)
    {
    	if(c=='(' || c==')') return 1;
    
    	return 0;
    }

    Comment

    • anushhprabu
      New Member
      • Sep 2006
      • 43

      #3
      Originally posted by Banfa
      Yes but I would have though this function would be better written as

      Code:
      int _isBrace_(char c)
      {
      	if(c=='(' || c==')') return 1;
      
      	return 0;
      }
      Thank you ;).. i made the code.. actually i need to throw exception from the header file.. thats why.. now i got it..
      thank you very much.. :)

      Comment

      Working...