5
Table
- #include <iostream>
- using namespace std;
- int main() {
- const int TABSIZE = 4;
- float tab[ TABSIZE ];
- cout << "Enter 4 reals: \n";
- for ( int i = 0; i < TABSIZE; i++ )
- cout << i+1 << ": ", cin >> tab[ i ];
- cout << "You have entered (in reverse order): \n";
- for ( int i = TABSIZE-1; i >= 0; i-- )
- cout << i+1 << ": " << tab[ i ] << endl;
- cout << "Here are their addresses in memory: \n";
- for ( float *p = tab; p < tab+TABSIZE; p++ )
- cout << *p << "\t-> 0x" << p << endl;
- }
Comments