Results 1 to 6 of 6

Thread: Type Casting Issue

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Question Type Casting Issue

    Can anyone tell me ???Why i am getting Error.when i tried to run the following code.let me know please.
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    
    namespace CastingDemo
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
               Int16 a= 10;
               Int32  b= 20;
               Int16 c;
               c = short(a + b);
               MessageBox.Show(c);
                
            }
        }
    }
    Last edited by firoz.raj; May 30th, 2011 at 02:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width