Results 1 to 20 of 20

What is typecasting?

This is a discussion on What is typecasting? within the Programming forums, part of the Web Designing & Development category; Typecasting converts entity of one type to entity of another type. It is very important while developing applications. Casting is ...

  1. #1
    Senior Member chinmay.sahoo's Avatar
    Join Date
    Dec 2013
    Location
    Banglore
    Posts
    266

    Thumbs up What is typecasting?

    Typecasting converts entity of one type to entity of another type. It is very important while developing applications.
    Casting is of two types:-
    1. downcasting
    2. Upcasting

  2. #2
    Senior Member
    Join Date
    Jan 2012
    Posts
    2,074

    Default Re: What is typecasting?

    Type casting is a way to convert a variable from one data type to another data type. For example, if you want to store a 'long' value into a simple integer then you can type cast 'long' to 'int'. You can convert the values from one type to another explicitly using the cast operator as follows − (type_name) expression.

  3. #3
    Senior Member pxljobs's Avatar
    Join Date
    Jul 2016
    Location
    Bangalore
    Posts
    128

    Default Re: What is typecasting?

    This is an process of modifying the variable from one data type to another type..

  4. #4
    Senior Member
    Join Date
    Mar 2017
    Posts
    233

    Default Re: What is typecasting?

    In programming, typecasting, also known as type conversion or coercion, is the conversion, either implicit or explicit, of one type into another.

  5. #5
    Senior Member
    Join Date
    May 2017
    Posts
    477

    Default Re: What is typecasting?

    typecasting is the process by which a particular actor becomes strongly identified with a specific character one or more particular roles or characters having the same traits or coming from the same social or ethnic groups.

  6. #6
    Senior Member
    Join Date
    Jun 2017
    Posts
    100

    Default Re: What is typecasting?

    Type casting is a way to convert a variable from one data type to another data type.

  7. #7
    Senior Member
    Join Date
    Nov 2016
    Posts
    152

    Default Re: What is typecasting?

    Nice. Short but right..!

    Quote Originally Posted by Sreesri View Post
    typecasting is the process by which a particular actor becomes strongly identified with a specific character one or more particular roles or characters having the same traits or coming from the same social or ethnic groups.

  8. #8
    Senior Member yatishkumar's Avatar
    Join Date
    Jul 2017
    Location
    Bangalore
    Posts
    100

    Default Re: What is typecasting?

    Type Casting, There is two types of type casting implicit and explicit type casting. Implicit type casting happens automatically by the compiler for example-byte->short->int->float->double. Whereas in Explicit type casting you need to specify for example- to downcast float to an int type you need to specify like float(int).

  9. #9
    Senior Member Ashley234's Avatar
    Join Date
    May 2017
    Posts
    336

    Default Re: What is typecasting?

    Type casting is a way to convert a variable from one data type to another data type.

  10. #10
    Member
    Join Date
    Jul 2017
    Posts
    35

    Default Re: What is typecasting?

    The process of converting one datatype into another datatype is called casting.
    up casting =>converting datatypes from lower to higher size ex. short to int.
    down casting=>converting datatypes from higher to lower size ex.long to short.

  11. #11
    Senior Member
    Join Date
    Nov 2016
    Posts
    152

    Default Re: What is typecasting?

    Agree with you..!

    Quote Originally Posted by Sreesri View Post
    typecasting is the process by which a particular actor becomes strongly identified with a specific character one or more particular roles or characters having the same traits or coming from the same social or ethnic groups.

  12. #12
    Junior Member byteshubb's Avatar
    Join Date
    Jul 2017
    Location
    india
    Posts
    28

    Default Re: What is typecasting?

    Typecasting is making a variable of one type, such as an int, act like another type, a char, for one single operation. To typecast something, simply put the type of variable you want the actual variable to act as inside parentheses in front of the actual variable.

  13. #13
    Senior Member
    Join Date
    May 2017
    Posts
    477

    Default Re: What is typecasting?

    Typecasting enables data type conversion. C++ supports Implicit conversions and Explicit conversion. Implicit conversions automatically performed when a value is copied to a compatible type.

  14. #14
    Junior Member homautomation's Avatar
    Join Date
    Jul 2017
    Location
    21 NWA, 3rd Floor, Punjabi Bagh Club Road, New Delhi
    Posts
    27

    Default Re: What is typecasting?

    Type casting is a way to convert a variable from one data type to another data type

  15. #15
    Senior Member charlottegracie's Avatar
    Join Date
    Jan 2017
    Posts
    207

    Default Re: What is typecasting?

    C++ is very strict about type compatibility. Different variable types must be cast when their values are assigned to each other. Type cast operator is used for explicit type conversion of variables. A type name behaves as if it is a function for converting values to a designated type.

  16. #16
    Member
    Join Date
    Sep 2016
    Posts
    46

    Default Re: What is typecasting?

    Thanks For Your Information.

  17. #17
    Member
    Join Date
    Jul 2017
    Posts
    63

    Default Re: What is typecasting?

    Typecasting enables data type conversion. C++ supports Implicit conversions and Explicit conversion. Implicit conversions automatically performed when a value is copied to a compatible type. If there is an operation between an int and a float, the int is promoted to float before performing operation.

  18. #18
    Member
    Join Date
    Sep 2017
    Posts
    60

    Default Re: What is typecasting?

    Typecasting enables data type conversion. C++ supports Implicit conversions and Explicit conversion. Implicit conversions automatically performed when a value is copied to a compatible type.

  19. #19
    Member
    Join Date
    Mar 2018
    Location
    Santa Clara, California, USA
    Posts
    40

    Default Re: What is typecasting?

    Typecasting in Java is to cast one type, a class or interface, into another type i.e. another class or interface
    Read more: goo.gl/TuF1Wl

  20. #20
    Junior Member
    Join Date
    Apr 2018
    Posts
    15

    Default Re: What is typecasting?

    The process of converting one Primitive data type to another Primitive data type is called Typecasting.There are Two types of casting:-
    1.) Primitive Casting
    2.) Derived Casting

Tags for this Thread