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

minify - Minimizing css files -

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -