
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are explicit type conversions in C#?
Explicit conversions require a cast operator.
These conversions are done explicitly by users using the pre-defined functions.
Let us see an example to cast double to int −
Example
using System; namespace Demo { class Program { static void Main(string[] args) { double d = 345.78; int i; Console.WriteLine("double: "+d); i = (int)d; Console.WriteLine("int: "+i); Console.ReadKey(); } } }
- Related Questions & Answers
- What are implicit and explicit type conversions in C language?
- What are implicit type conversions in C#?
- Explicit type casting operator in C++
- Explicit Type Casting in Python Language
- What is the difference between implicit and explicit type conversion in C#?
- What are type qualifiers in C++?
- What are type specifiers in C++?
- What are primitive data type in C++?
- What does the explicit keyword mean in C++?
- What does explicit wait perform?
- Use of explicit keyword in C++
- Java Conversions and Promotions
- What are the differences between implicit and explicit waits in Selenium with python?
- Different ways for Integer to String Conversions in C#
- What are the differences between Widening Casting (Implicit) and Narrowing Casting (Explicit) in Java?
Advertisements