home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
TCPP30-3.ZIP
/
EXAMPLES.ZIP
/
INTRO28.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-02-18
|
584b
|
28 lines
// INTRO28.CPP--Example from Chapter 3, "An Introduction to C++"
#include <iostream.h>
int main()
{
float hours[52];
int week;
// Initialize the array
for (week = 0; week < 52; week++)
hours[week] = 0;
// Store four values in array
hours[0] = 32.5;
hours[1] = 44.0;
hours[2] = 40.5;
hours[3] = 38.0;
// Retrieve values and show their addresses
cout << "Element "<< "\tValue " << "\tAddress\n";
for (week = 0; week < 4; week++)
cout << "hours[" << week << "]" << '\t'
<< hours[week] << '\t' << &hours[week] << '\n';
return 0;
}