Search
 
SCRIPT & CODE EXAMPLE
 

CPP

cpp custom exception

int main()
{
   int err = -99;
   cout << "Before try 
";
   try {
      cout << "Inside try 
";
      if (err < 0)
      {
         throw err;
         cout << "After throw (Never executed) 
";
      }
   }
   catch (int err ) {
      cout << "Exception Occured! 
";
   }
 
   cout << "After catch (Will be executed) 
";
   return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ length of int 
Cpp :: C++ function inside main 
Cpp :: valid parentheses in c++ 
Cpp :: phi function (n log (log(n))) 
Cpp :: c++ check first character of string 
Cpp :: nth fibonacci number 
Cpp :: c++ last element of array 
Cpp :: How to see gateway on linux 
Cpp :: min heap 
Cpp :: replace a char in string c++ at a specific index 
Cpp :: queue cpp 
Cpp :: create a copy of a vector c++ 
Cpp :: ue4 endoverlap c++ 
Cpp :: rc.local not running centos 6 
Cpp :: gtest assert not equal 
Cpp :: error: use of parameter outside function body before ] token c++ 
Cpp :: how to read rotary encoder c++ 
Cpp :: warning: base will be initialized after 
Cpp :: variable modulus 5 meaning in c++ 
Cpp :: pointer in cpp details 
Cpp :: C++ for vs while loops 
Cpp :: c++ dynamic array 
Cpp :: txt to pdf CPP 
Cpp :: create dynamic variable c++ 
Cpp :: std::copy 
Cpp :: convert c++ to c language 
Cpp :: Corong_ExerciseNo3(1) 
Cpp :: http://nv-study.ru/http://nv-study.ru/http://nv-study.ru/ 
Cpp :: what is stdoutread in c++ 
Cpp :: [3,2,4,-1,-4] 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =