title: Casting float to (int) in C - declaring cast (int) seems to have no effect
body: <p>C program takes float value as command line argument, so need to format from string to float and then to integer. Using round() from math.h, and then want to cast to int. </p>
  
  <p>Casting by declaring (int) before value, but value type does not change. </p>
  
  <p>Code below: </p>
  
  <pre><code>double *f = (double *) malloc(sizeof(double));
  *f = (int)roundf(atof(argv[1]));
  printf("Testing f: %d", *f);
  </code></pre>
  
  <p><code>make</code> gives this error message:</p>
  
  <pre class="lang-none prettyprint-override"><code>format specifies type 'int' but the argument has type 'double'
        [-Werror,-Wformat]
      printf("Testing f: %d", *f);
  </code></pre>