Why numbers is getting approximated in dynamic memory allocation? -


#include <iostream> using namespace std;  int main () { double* pvalue  = null; // pointer initialized null pvalue  = new double;   // request memory variable  *pvalue = 29494.99;     // store value @ allocated address cout << "value of pvalue : " << *pvalue << endl;  delete pvalue;         // free memory.  return 0; } 

the result : value of pvalue : 29495 not actual value


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -