answersLogoWhite

0


Best Answer

A cast operator explicitly converts a value to the specified data type.

The following are common cast operators in C.

(int)

(char)

(string) *i'm not completely sure this is the one for string*

Placing any of these cast operators in front of any variable or expression will convert its value to the specified type. If you have the number 4 stored as a character in the variable x, then you may use the cast (int) so that the number will be seen as an integer value for mathematical operations. See below:

int main()

{

char x = 4;

int answer;

// Perform the operation, 5 - x

// You may be tempted to use the following code to perform the operation:

answer = 5 - x;

//Doing this will result in a garbage value for answer.

//The following will give the proper answer

answer = 5 - (int)x;

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is mean of cast operator?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What actors and actresses appeared in Operator - 2012?

The cast of Operator - 2009 includes: Matthew Calver as Man


What is meant by cast operator?

Casting operator used in implicite conversion.Because,it reduce the data lossing in imolicit conversion.


What do you mean by operator?

he who operate the computer.


What actors and actresses appeared in The Telegraph Operator - 1913?

The cast of The Telegraph Operator - 1913 includes: Barbara Tennant as Bess


What actors and actresses appeared in The Elevator Operator - 2005?

The cast of The Elevator Operator - 2005 includes: Eugene Sheiman as himself


What actors and actresses appeared in Drone - 2013?

The cast of Drone - 2013 includes: Ewen Bremner as Drone Operator Alex Corbet Burcher as Drone Operator Daniel Jewel as Drone Suspect Kari Kleiv as Drone Operator Akie Kotabe as Drone Operator Parker Sawyers as Drone Operator Alan Turkington as Drone Operator


What does FBO mean?

Fixed base operator


What actors and actresses appeared in Surrounded - 2013?

The cast of Surrounded - 2013 includes: Lalle Luna as Machine Operator Frank Opitz as Machine Operator Jonas Phokus Brommer as Machine Operator Martin Sukale as Machine Operator


What does it mean when a pleasure craft operator displays a square flag with a ball above or below it?

The operator needs assistance


Do you have source code in c for assignment operator?

I'm not sure what you mean, but the c assignment operator is the equal sign, =


What does op mean in minecraft pocket edition?

Operator


C coding for operator overloading?

C does not support operator overloading. If you mean C++ operator overloading, it depends on exactly what you wanted to do. If you wanted to '+' to strings, then you could write: string operator+(string a, string b) { // do something }