Write a program that will display the value and logical address of an uninitialized float array with size twenty (20) and a reference pointing to the array.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
#include "_pause.h"
usingnamespace std;
int main(){
float n[20];
float &ref = n[20];
float *ptr = &n[20];
cout << "The value is " << ref << endl;
cout << "The address is " << ptr << endl;
cout << endl;
_pause();
return 0;
}
The value is 8.99955e-039
The address is 0x61ff18
Press any key to continue. . .