ok now it compiles and links fine and everything but im getting an error when it runs from microsoft saying that it encountered a problem and has to close??
#include <iostream>
#include <iomanip>
using namespace std;
class Array
{
public:
Array();
//Array(const Array& copyFrom);
~Array() { };
void append(int arrayA[]);
void chop(int arrayA[], int subtract);
void print(int arrayA[], int arrayB[], int arrayC[]);
void values(int arrayA[], int arrayB[], int *ptr, int *p);
void is_equal(int arrayA[], int arrayB[], int arrayC[]);
private:
int add,
subtract;
};
void main()
{
int arrayA[5] = {1,2,3,4,5},
arrayB[7] = {1,2,3,4,5,0,0},
arrayC[5] = {1,2,3,4,5};
int //copyFrom,
*ptr = 0,
subtract = 0,
*p = 0;
Array nums;
Array();
//Array(Array& copyFrom);
nums.values(arrayA, arrayB, ptr, p);
nums.print(arrayA, arrayB, arrayC);
nums.append(arrayA);
nums.print(arrayA, arrayB, arrayC);
nums.chop(arrayA, subtract);
nums.print(arrayA, arrayB, arrayC);
cout << "Check to see if any array's are equal" << endl;
nums.is_equal(arrayA, arrayB, arrayC);
}//main
Array::Array()
{
int *ptr = 0;
int *p = 0;
}
/*Array::Array(const Array& copyFrom)
{
int arrayA[5] = copyFrom.arrayA[5];
}// end copy
*/
void Array::append(int arrayA[])
{
cout<<"Enter the number you are inserting\n\n";
cin>> add;
cout << "We will insert " << add << " into Array A\n" << endl;
arrayA[5-1] = add;
}//end append
void Array::chop(int arrayA[], int subtract)
{
subtract = NULL;
cout << "Now we will delete that value from the Array" << endl;
arrayA[5] = subtract;
}
void Array::values(int arrayA[], int arrayB[], int *ptr, int *p)
{
*ptr = arrayA[5];
*p = arrayB[7];
}// end values
void Array::print(int arrayA[], int arrayB[], int arrayC [])
{
cout << "Array A is: " << endl;
for(int i = 0; i < 5; i++)
cout << arrayA[i] << " ";
cout << "\n\n";
cout << "Array B is: " << endl;
for(int j = 0; j < 7; j++)
cout << arrayB[j] << " ";
cout << "\n\n";
cout << "Array C is: " << endl;
for(int k = 0; k < 5; k++)
cout << arrayC[k] << " ";
cout << "\n\n";
}//print
void Array::is_equal(int arrayA[], int arrayB[], int arrayC[])
{
for(int i = 0; i < 5; i++)
cout << arrayA[i] << " ";
cout << endl;
for(int j = 0; j < 7; j++)
cout << arrayB[j] << " ";
cout << endl;
if(arrayA[i] == arrayB[j])
cout << "True" << endl;
else
cout << "False" << endl;
for (i = 0; i < 5; i++)
cout << arrayA[i] << " ";
cout << endl;
for( j = 0; j < 5; j++)
cout << arrayC[j] << " ";
cout << endl;
if(arrayA[i] == arrayC[j])
cout << "True" << endl;
else
cout << "False" << endl;
}