Type cast operator, C/C++ Programming

What is Type Cast Operator:

 

The float can be converted to integer value or an integer can be converted to float value using type cast operator.

avg = sum/(float)i; //Syntax in C

avg = sum/float(i); //Syntax in C++.  This is like passing the identifier as argument in the function.

There are other type cast operators in C++ which will be discussed later.

·     const_cast

·     static_cast

·     dynamic_cast 

·     reinterpret_cast

Posted Date: 9/20/2012 7:37:55 AM | Location : United States







Related Discussions:- Type cast operator, Assignment Help, Ask Question on Type cast operator, Get Answer, Expert's Help, Type cast operator Discussions

Write discussion on Type cast operator
Your posts are moderated
Related Questions
Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should


Why can't one open a file in a different directory like "..\test.dat"? A: Since " " is a tab character. You must employ forward slashes in your filenames, even on operating s

Create a pseudocode in getting Calendar Quarter. The program should identify which quarter falls the given date. Note: Consider the date format DDMMYYYY.

Respected Sir, I want the above written text in a C program

Program is to define a class as teacher: Program is to define a class as teacher and collect information about them by using classes and object class teacher   {   pr


how can i write reverse digit function like writing 1234 and printing 4321

if one won't explicitly call the destructor of a local; then how does he handle the above situation?

Define the Data Types of c language? The C has a concept of 'data types' which are used to define a variable before its use and the definition of a variable will assign storage