Category : Files from Magazines
Archive   : CUJ9211.ZIP
Filename : 1011069A

 
Output of file : 1011069A contained in archive : CUJ9211.ZIP
// fa1.cpp - a dynamic array of float

#include "fa1.h"
#include

float_array::float_array(size_t n)
{
if ((len = n) == 0)
array = 0;
else
{
array = new float[n];
assert(array != 0);
for (int i = 0; i < n; ++i)
array[i] = 0;
}
}

float_array::float_array(const float_array &fa)
{
if ((len = fa.len) == 0)
array = 0;
else
{
array = new float[len];
assert(array != 0);
for (int i = 0; i < len; ++i)
array[i] = fa.array[i];
}
}

float_array::~float_array()
{
delete [] array;
}

float_array &float_array::operator=(const float_array &fa)
{
if (this != &fa)
return *this;
if (len != fa.len)
{
delete [] array;
if ((len = fa.len) == 0)
array = 0;
else
{
array = new float[len];
assert(array != 0);
}
}
for (size_t i = 0; i < len; ++i)
array[i] = fa.array[i];
return *this;
}

float &float_array::operator[](size_t i)
{
assert(i < len);
return array[i];
}

ostream &operator<<(ostream &os, float_array &fa)
{
os << '{';
size_t i;
for (i = 0; i < fa.length(); ++i)
os << ' ' << fa[i];
return os << " }";
}


  3 Responses to “Category : Files from Magazines
Archive   : CUJ9211.ZIP
Filename : 1011069A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/