home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_01
/
1101096a
< prev
next >
Wrap
Text File
|
1992-11-03
|
645b
|
34 lines
#include <iostream.h>
#include "fa4.h"
void display(const char *s, const float_array &fa)
{
cout << s << " = " << fa << endl;
}
int main()
{
size_t i, size;
cout << "size? ";
cin >> size;
float_array fa(size);
for (i = 0; i < fa.length(); ++i)
fa[i] = i;
display("fa", fa);
float_array fb = fa;
display("fb", fb);
for (i = 0; i < 2 * size; ++i)
{
fb[i] = i * i;
display("fb", fb);
}
const float_array fc = fa;
display("fc", fc);
cout << "fc[size] = " << fc[size] << '\n';
return 0;
}
----------