Mega Code Archive

 
Categories / C++ / Data Type
 

Float value pointer and int value pointer

#include <iostream> using namespace std; int main() {   float *f;   int *i;   f = new float;   i = new int;   if(!f || !i) {     cout << "Allocation error\n";     return 1;   }   *f = 10.101;   *i = 100;   cout << *f << ' ' << *i << '\n';   delete f;   delete i;   return 0; }