Operations on different data types

chshbh

When i was dividing a int variable with a float variable, it was giving correct answer. I thought data types needed typecasting to be, for one data type cant operate with another kind of data type. If not, then how does the processor decide it can operate int and float, but not int and char.

Ayushi Jha

In cases where you have not explicitly typecast the variables, implicit typecasting is performed. An example of how implicit typecasting works :

int variable = (int / float ) -> variable will have an integer value.

float variable = (int / float ) -> variable will have a float value.

An example using char and int :

int a=0; 
char c='c'; 
a = c; 
cout<<"Ascii value of"<<c<<"is "<<a; 

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

operations with different int types

From Dev

math operations with different types in C

From Dev

Haskell: arithmetic operations on data types

From Dev

Performing operations on custom data types?

From Dev

Share data with different types in UIActivityViewController

From Dev

Constructor and different data types are confusing

From Dev

Mutable list with different types of data

From Dev

Mutable list with different types of data

From Dev

Different Data types Order By in SQL

From Dev

Object data with 2 different types

From Dev

TreeTableView: Displaying different data types

From Dev

Maths Operations on Columns from Different Data Frames

From Dev

Maths Operations on Columns from Different Data Frames

From Dev

JavaFX Compilation Warning - "uses unchecked or unsafe operations" - Raw Data Types?

From Dev

Can a linkedlist store different data types?

From Dev

Matlab array having columns of different data types?

From Dev

Can mysql join occur on different data types

From Dev

Spring Data Mongodb - repository for collection with different types

From Dev

LINQ Join On Multiple Columns With Different Data Types

From Dev

how size of a structure varies with different data types

From Dev

core data: save different types as the same attribute

From Dev

Use a single method to return data with different types

From Dev

Can a method be able to return different data types?

From Dev

Elasticsearch mapping - different data types in same field

From Dev

Single struct adjusting methods to different data types

From Dev

Distinguishing between the different data types in Java

From Dev

error converting different data types (int and strings)

From Dev

How to use MapStruct for different data types?

From Dev

Read different types of clipboard data with ctypes in python

Related Related

  1. 1

    operations with different int types

  2. 2

    math operations with different types in C

  3. 3

    Haskell: arithmetic operations on data types

  4. 4

    Performing operations on custom data types?

  5. 5

    Share data with different types in UIActivityViewController

  6. 6

    Constructor and different data types are confusing

  7. 7

    Mutable list with different types of data

  8. 8

    Mutable list with different types of data

  9. 9

    Different Data types Order By in SQL

  10. 10

    Object data with 2 different types

  11. 11

    TreeTableView: Displaying different data types

  12. 12

    Maths Operations on Columns from Different Data Frames

  13. 13

    Maths Operations on Columns from Different Data Frames

  14. 14

    JavaFX Compilation Warning - "uses unchecked or unsafe operations" - Raw Data Types?

  15. 15

    Can a linkedlist store different data types?

  16. 16

    Matlab array having columns of different data types?

  17. 17

    Can mysql join occur on different data types

  18. 18

    Spring Data Mongodb - repository for collection with different types

  19. 19

    LINQ Join On Multiple Columns With Different Data Types

  20. 20

    how size of a structure varies with different data types

  21. 21

    core data: save different types as the same attribute

  22. 22

    Use a single method to return data with different types

  23. 23

    Can a method be able to return different data types?

  24. 24

    Elasticsearch mapping - different data types in same field

  25. 25

    Single struct adjusting methods to different data types

  26. 26

    Distinguishing between the different data types in Java

  27. 27

    error converting different data types (int and strings)

  28. 28

    How to use MapStruct for different data types?

  29. 29

    Read different types of clipboard data with ctypes in python

HotTag

Archive