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
C program to show overloading of matrix operator: Write a program for matrix operator overloading. class matrix{                   private :                 int x[

How do one throw polymorphically?               A: Sometimes people write code such as: class MyExceptionBase { }; class MyExceptionDerived : public MyExceptionBase { };

You are to implement a code cracking system. The system will deploy four processes (p1,p2,p3 & p4) to try to guess the password of an encrypted code. For encryption, we consider th

Write a C program to input 16 numbers and print them out in a table format of 4 wide by 4 deep. E.g.   4    5    5    7   8    9    10    11   12    13    14    15   16    17

#question.develop an algorithm using pseudocode for computing cos(x) and sin(x). use a sentinel controlled while loop. use the series definition of e^+-jx

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


Write a fully modular C program that reads in a string of a defined size from the keyboard and reports how many times each letter of the alphabet occurs within that string (ignorin

Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i

Question : (a) (i) What is a structure member in C? What is the relationship between a structure member and the structure? (ii) How can structure variables be declared in C?