omariqbalnaru@inbox.com Guest
|
Posted: Sat Aug 26, 2006 8:55 am Post subject: casting |
|
|
#include<iostream>
using namespace std;
int main()
{
int i, *pi;
float f, *pf;
i = 1024;
pi = &i;
pf = (float *) pi;
f = *pf;
cout << " i = " << i << " f = " << f << "\n \n";
f = i;
cout << " i = " << i << " f = " << f << "\n \n";
return 0;
}
In the statement:
pf = (float *) pi;
of the above program. Is that what we call casting of a int pointer to
a float pointer? |
|