5

Table

  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     const int TABSIZE = 4;
  7.     float tab[ TABSIZE ];
  8.  
  9.     cout << "Enter 4 reals: \n";
  10.  
  11.     for ( int i = 0; i < TABSIZE; i++ )
  12.         cout << i+1 << ": ", cin >> tab[ i ];
  13.  
  14.     cout << "You have entered (in reverse order): \n";
  15.  
  16.     for ( int i = TABSIZE-1; i >= 0; i-- )
  17.         cout << i+1 << ": " << tab[ i ] << endl;
  18.  
  19.     cout << "Here are their addresses in memory: \n";
  20.  
  21.     for ( float *p = tab; p < tab+TABSIZE; p++ )
  22.         cout << *p << "\t-> 0x" << p << endl;
  23. }

Comments

Your comment:
[p] [b] [i] [u] [s] [quote] [pre] [br] [code] [url] [email] strip help 2000

Enter a maximum of 2000 characters.
Improve the presentation of your text with the following formatting tags:
[p]paragraph[/p], [b]bold[/b], [i]italics[/i], [u]underline[/u], [s]strike[/s], [quote]citation[/quote], [pre]as is[/pre], [br]line break,
[url]http://www.izend.org[/url], [url=http://www.izend.org]site[/url], [email]izend@izend.org[/email], [email=izend@izend.org]izend[/email],
[code]command[/code], [code=language]source code in c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].