well this a parallel array and also be able to process the arrays but it doesn't do so can some one give me a hint of what i might be doing wrong. Thank you before hand.
-------------------------------------------------------------------------
#include <iostream>
#include <new>
using namespace std;
int main ()
{
int DOB [10]=
{1980,1981,1982,1983,1984,1985,1986,1987,1988,1989};
int age [10]={60,61,62,63,64,65,66,67,68,69,70};
string name[10]={"Luis","Sarah", "Hope", "Joseph", "Brian","Cameron","Christin","Crystal","Henry","George"};
int id;
int numbOfpeople,n;
int * yrOfbirth;
cout<<"Enter social ID ";
cin>>id;
cout << "Enter how many people: ";
cin >> numbOfpeople;
yrOfbirth= new(nothrow) int[numbOfpeople];
if (yrOfbirth == 0)
cout << "Error: memory could not be allocated";
else
{
for (n=0; n<numbOfpeople; n++)
{
cout << "Enter the year :";
cin >> year[n];
}
}
delete[] year;
cout <<"\n\n\t\t\tHospital \n\n";
cout <<"\n********************************************************************** \n" ;
for (int i=0; i<12; i++)
{
if ( yrOfbirth[n]==DOB[i])
{
cout<<"\n\t "<<DOB[i]<< " \t\t " <<age[i]<< " \t\t "<<name[i]<<"\n";
}
}
cout<<"\nThank You " ;
system ("pause");
return 0;
}