Difference between directcast and ctype
Hi all,  

I am newer to C#.net. Anyone please tell me the difference between directcast and ctype

Thanks in Advance..

See All Responses Below...
Author
Message Rating
Posted on: 23/05/2012

The Ctype()function is used to cast an object from one type to another.

DirectCastrequires the run-time type of an object variable to be the same as thespecified type.

Posted on: 23/05/2012
Adding one more point CType also incorporates additional safety when casting form one object to another which is not present in Direct Cast ..

Tom

Share this page across other social networking sites



Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Comments
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site.