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
I need help programing this... In this exercise, you will create a program for the sales manager at Computer Haven, a small business that offers motivational seminars to local comp

Most first graders know that nine hundred and ninety nine plus one is one thousand, but C++ doesn't! Sure, a computer can easily compute 999 + 1 and get 1000. But reading and writi


Buddy systems : A method of handling the storage management problem is kept individual free lists for blocks of dissimilar sizes. Every list having free blocks of only one particul

Compiler Design - Limit In The Method Instructions

write a program that calculates points along a rhodonea curve.... ? int fillArray( double data[ ], int nValues, double min, double max ); o Used to fill in the theta array. Return

Question: a) Give two uses of NFS. b) Give one advantage of using NFS. c) Explain the following lines as they would be interpreted in the /etc/exports file i. /usr/local

Explain about the Variables in c language? The Variable is an identifier that is used to represent some specified kind of information within a designated portion of the program


Private derivation If no specific derivation is listed, then a private derivation is supposed. If a new class is derived privately from its parent class, then: The priva