Co to jest rzutowanie typów w języku c

Przykłady kodu

2
0

casting w c

#include <stdio.h>
#include <stdlib.h>
int main(){
  int x = 7, y = 5;
  float z;
  z = (float)x / (float)y;   /*Here the value of z is 1.400000*/
  return 0;
}
1
0

co to jest rzutowanie typów w programowaniu w języku c

Type casting refers to changing an variable of one data type into another. 
The compiler will automatically change one type of data into another if it
makes sense. For instance, if you assign an integer value to a floating-point
variable, the compiler will convert the int to a float. Casting allows you to 
make this type conversion explicit, or to force it when it wouldn’t normally 
happen.

W innych językach

Ta strona jest w innych językach

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................