Results 1 to 4 of 4

Thread: How are Runtime error handled in C# ?

  1. #1
    Join Date
    Dec 2010
    Posts
    49

    How are Runtime error handled in C# ?

    I am a a novice programmer, I am pursuing a .Net course after which I will be a professional in ASP.NET and use the Microsoft Visual studio to compile the code , but before that I will have to learn the C# language completely , I have used your technical forums to learn all the basic thing and solve a and get rid of the doubts that had come to my mind , so can you please tell me how does this C# handles the run time error also tell me a bit about those errors.

  2. #2
    Join Date
    May 2009
    Posts
    511

    Re: How are Runtime error handled in C# ?

    If you are not aware about the process , whenever you code any program and save it , once the program is compiled that means .exec file is created and in order to execute it completely the .exec should run successfully , but if that does not happen then it is said the run time error has occurred , this mostly happens due to incorrect logic being applied in the code.

  3. #3
    Join Date
    May 2009
    Posts
    527

    Re: How are Runtime error handled in C# ?

    Code:
    using system :
    class err
    {
     public static void main ()
     int x = 10; 
     int y = 5;  
     int z = 5;
    
    int a = x/(y-z);
    Console.WriteLine(" the result of the given expression is " +a); 
    }

    The above code will result in a run time error , while you can see that it will generate into a run time error since the expression includes division by zero , as the difference between the y and z variables results in zero and it divides the value stored in variable x, since the any value divided with zero results in a not defined value , it will generate an exception. you will have to catch those exception.

  4. #4
    Join Date
    May 2009
    Posts
    539

    Re: How are Runtime error handled in C# ?

    "Exception is a runtime errors that comes or encounters due to some abnormal sequence being adopted in a code sequence. In C# Exception is a class in the system namespace. An instance of an exception is that explain the exceptional circumstances take place in a code that means, we are catching an exception, generating an object of it, and later on throwing it. C# supports exception very much the similar technique . You can use the the Try and catch block to handle it.

Similar Threads

  1. Replies: 3
    Last Post: 22-04-2009, 11:02 PM
  2. Microsoft Visual C++ Runtime Library... Runtime Error
    By Joko in forum Software Development
    Replies: 2
    Last Post: 17-02-2009, 09:52 PM
  3. Microsoft Visual C++ Runtime Library Symantec Runtime error
    By Ranchero in forum Windows XP Support
    Replies: 8
    Last Post: 27-09-2008, 09:08 AM
  4. Microsoft Visual C++ Runtime Library - Runtime Error
    By Leythos in forum Windows XP Support
    Replies: 3
    Last Post: 01-10-2007, 11:45 PM
  5. Replies: 6
    Last Post: 14-11-2006, 03:37 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,826,376.17174 seconds with 17 queries