#include "Data.h"
#include "Heap.h"
#include "PQ.h"
#include <iostream>
using namespace std;
//**********************************************************
void enqRequest(int newTrackNum, int currP ,int serialNumber,bool
forwardDir, itemClass &item(int &newTrackNum,int &serialNumber))
{
cout << "Do the EnqRequest function."<<endl;
cout <<endl<<endl;
cout <<"Enter a New Track Number"<<endl;
cin >> newTrackNum;
if (newTrackNum >= 0 && newTrackNum <= 9) {
cout <<"EnqRequest "<<newTrackNum<<endl;
cout << endl << endl;
cout <<"Current Position: .............."<<currP<<endl;
cout <<"Current Direction: ............."<<endl;
cout <<"Request was Enqueued in the: ..."<<endl;
cout <<"Number of Request is: ......"<<endl;
cout <<"====================================================================== ======"<<endl;
}
else
cout <<"Please Enter a number request between 0-9"<<endl;
}
//**********************************************************
int main(void) {
bool user = true;
bool fowardDir= true;
string commandUser;
int trackNum, currentPosition,T;
T=0;
pqItemType forward;
pqItemType reverse;
itemClass item(int trackNum, int T);
currentPosition=0;
cout << "WELCOME TO THE DISK SCHEDULER"<<endl;
cout << "THE COMMANDS AVAILABLE TO YOU ARE \"EnqRequest\", \"ServeRequest\", \"PrintState\", AND \"Quit\"\n";
cin >> commandUser;
std::transform(commandUser.begin(), commandUser.end(), commandUser.begin(), ::toupper);
do{
if ( commandUser == "ENQREQUEST" )
{
enqRequest(trackNum,currentPosition,T,fowardDir,&item);
cout << "THANK YOU FOR USING THE DISK SCHEDULER"<<endl;
cout << "THE COMMANDS AVAILABLE TO YOU ARE \"EnqRequest\", \"ServeRequest\", \"PrintState\", AND \"Quit\"\n";
cin >> commandUser ;
std::transform(commandUser.begin(), commandUser.end(), commandUser.begin(), ::toupper);
}
else
{
cout << "Please, enter a command" << endl;
cin >> commandUser;
std::transform(commandUser.begin(), commandUser.end(), commandUser.begin(), ::toupper);
}
}while (user);
return 0;
}
I have an object item with arguments (int trackNum, int T); I am trying to pass a reference to this object into enqRequest function and other functions not made yet. When I pass the objects reference, do I also have to specifically pass arguments used by the object itself? For example
void enqRequest(itemClass &item(int &newTrackNum,int &serialNumber))