#include <iostream>
#include <fstream>
#include <vector>
#include <cstdlib>
#include "class.h"
#include "class.cpp"
usingnamespace std;
int main(){
lList list;
Node* rat = new Node;
int input;
do {
system("cls");
list.Show();
cout << "\n Make A Choice Sir : ...\n";
cout << "|-1-|Add A New Manager .\t|-2-|Add A New Vehicle .\n";
cout << "|-3-| Delete Manager .\t|-4-|Delete Vehicle .\n";
cout << "|-5-|Assign Vehicle To Manager .|-6-|UnAssign Vehicle From Manager .\n";
cout << "|-7-|Make The List Empty .\t|-0-|Exit .";
cout << "\n Your Choice Is ->>> " ;
list.checkInputNum(input);
switch (input){
case 1:
list.addNode('m');
break;
case 2:
list.addNode('v');
break;
case 3:
list.deleteNode('m');
break;
case 4:
list.deleteNode('v');
break;
case 5:
list.assignVehicle("assign");
break;
case 6:
list.assignVehicle("unassign");
break;
case 7:
list.makeEmpty();
break;
}
}while(input != 0);
}
In file included from C:\Users\TOSHIBA\Desktop\work\main.cpp:6:0:
C:\Users\TOSHIBA\Desktop\work\class.cpp:145:6: error: redefinition of 'bool lList::validateManagerVehicle(Node*&, NodeVeh*&, std::string, std::string)'bool lList::validateManagerVehicle(Node* &man,NodeVeh* &veh,string strman,string strveh){
^
In file included from C:\Users\TOSHIBA\Desktop\work\main.cpp:5:0:
C:\Users\TOSHIBA\Desktop\work\class.h:35:6: error: 'bool lList::validateManagerVehicle(Node*&, NodeVeh*&, std::string, std::string)' previously defined here
bool validateManagerVehicle(Node* &man,NodeVeh* &veh,string strman,string strveh){};
^
In file included from C:\Users\TOSHIBA\Desktop\work\main.cpp:6:0:
C:\Users\TOSHIBA\Desktop\work\class.cpp:167:6: error: redefinition of 'void lList::assignVehicle(std::string)'void lList::assignVehicle(string order){
^
In file included from C:\Users\TOSHIBA\Desktop\work\main.cpp:5:0:
C:\Users\TOSHIBA\Desktop\work\class.h:36:6: error: 'void lList::assignVehicle(std::string)' previously defined here
void assignVehicle(string order){};
^
In file included from C:\Users\TOSHIBA\Desktop\work\main.cpp:6:0:
C:\Users\TOSHIBA\Desktop\work\class.cpp:197:6: error: redefinition of 'void lList::makeEmpty()'void lList::makeEmpty(){
^
In file included from C:\Users\TOSHIBA\Desktop\work\main.cpp:5:0:
C:\Users\TOSHIBA\Desktop\work\class.h:37:6: error: 'void lList::makeEmpty()' previously defined here
void makeEmpty(){};
^
In file included from C:\Users\TOSHIBA\Desktop\work\main.cpp:6:0:
C:\Users\TOSHIBA\Desktop\work\class.cpp:220:1: error: redefinition of 'lList::~lList()'
lList::~lList(){
^
In file included from C:\Users\TOSHIBA\Desktop\work\main.cpp:5:0:
C:\Users\TOSHIBA\Desktop\work\class.h:39:1: error: 'lList::~lList()' previously defined here
~lList(){};
^
help please it's for an assignment submission tomorrow.
thanks for making the time to answer and try my code wildblue .
so your saying it might be a compiler issue ??
and can you show me how do you issue the command to compiler to compile like "g++ ??" ??
No, neither wildblue nor helios were saying that this is a compiler issue. This is clearly a function redefinition issue.
What the macro "#include" does is copies + paste the contents of the source file you designate, into the destination file that it was invoked from, at the position that it is used. So then when you link to a source code file that you have also included, your linker sees the definition for a function with the exact same signature twice in the look-up table. This leads to a potential ambiguity error with overload resolution. Even though you and I both know that it is the exact same function, from the exact same source file, defined in exactly the same way across both instance, your linker does not care and won't even bother to check for that scenario. They each have the same name-decoration and this could potentially confuse the compiler and\or the run-time provider and that is all that it cares about.
Always try to remember that computers are incredibly stupid devices. You HAVE to hold their hand in everything that they do or else they will happily face plant while trying to perform even the simplest task.