title: C++ floating point to integer type conversions
body: <p>What are the different techniques used to convert float type of data to integer in C++?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  struct database {
    int id, age;
    float salary;
  };
  
  int main() {
    struct database employee;
    employee.id = 1;
    employee.age = 23;
    employee.salary = 45678.90;
    /*
       How can i print this value as an integer
       (with out changing the salary data type in the declaration part) ?
     */
    cout &lt;&lt; endl &lt;&lt; employee.id &lt;&lt; endl &lt;&lt; employee.
    age &lt;&lt; endl &lt;&lt; employee.salary &lt;&lt; endl;
    return 0;
  }
  </code></pre>