#include<iostream>
usingnamespace::std;
#include "MovieData.h"
void getMovieData(MovieData mov[], int size){
char temp[SIZE];
int tmp;
for(int i=0;i<size;i++){
temp[0]='\0';
tmp = 0;
cin.ignore();
cout<<endl;
cout<<"Enter the title of Movie #"<<i+1<<": ";
cin.getline(temp,SIZE,'\n');
mov[i].setTitle(temp);
cout<<"Enter the name of the director: ";
cin.getline(temp,SIZE,'\n');
mov[i].setDirector(temp);
cout<<"Enter the release date of the movie: ";
cin>> tmp;
mov[i].setYear(tmp);
cout<<"Enter the running time of the movie in minutes: ";
cin>> tmp;
mov[i].setrunTime(tmp);
}//end for
}
void getCostRev(MovieData mov[], int size){
int temp;
for(int i=0;i<size;i++){
cout<<endl;
cout<<"What were the costs of"<<endl;
cout<<"the movie "<<mov[i].getTitle()<<" ?: ";
cin>>temp;
mov[i].setCost(temp);
cout<<"What were its revenues?: ";
cin>>temp;
mov[i].setRevenue(temp);
}
}//end getCostRev
void printAllMovieData(MovieData movieArray[], int size){
for (int i=0; i<size; i++){
movieArray[i].print();
}
}//end printAllMovieData
I originally had the string library, which worked perfectly, but unfortunately I'm not allowed to use it for this particular program. I also changed them to character arrays but I still got the same output.
Yes, sorry I didn't say I had already changed the code on top of the page. And having those member values as character arrays makes it display the same symbol but more of them.