Advertisement
Archon

double-casts

Nov 23rd, 2010
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.18 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. int main(){
  4.    float f = 1.5;
  5.    printf("%f --> %d --> %f\n", f, (int)f, (float)(int)f);
  6.  
  7.    int i = 1;
  8.    printf("1 == %i\n", (int)(float)i);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement