main() { int var1; float var2; var2 = (float)var1; } |
As it happens this example would never be used in practice because C would perform the conversion automatically. What this example does show is the cast operator () . This states, the result of the expression (in this case var1) is to be a data type of float.
Archive:
Top | Master Index | Keywords | Functions |