1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Divide By Zero

Discussion in 'C++' started by Neo, Dec 27, 2006.

  1. Neo

    Neo New Member

    Joined:
    Dec 27, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Hi Friends,
    I am trying following code
    Code:
     int main(void) 
     { 
        try 
       { 
          int i,j,k; 
          i=10; 
          j=0; 
    
    
          k= i/j; 
        } 
       catch(...) 
       { 
         printf("Erro!~"); 
         return 1; 
       } 
      return 0; 
     } 
    
    Here it's divide by Zero error.

    Now using MSVC compiler. the code flow lands up in catch block.

    but gcc comiler the code simply throws "floating point exception" can terminates.

    Any comments??
     

Share This Page