Click here to Skip to main content
16,021,041 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using visual studio 2017 for my c++ project and had this error on the command line when trying to compile the program.
Error message was: path is not recognized as an internal or external command.

Any assistance is highly appreciated.

What I have tried:

#include <iostream>

using namespace std;

class emp {
public:
char* emp_name;
int getInfo(char* emp_name, int emp_id_number, int emp_age) {
cout << "Employee Name: " << emp_name << "\n";
cout << "Employee Id Number: " << emp_id_number << "\n";
cout << "Employee Age: " << emp_age;
}
};
class salary: public emp{ 
public:

int	getSalary(){
int tax_number;
cout << "\nEnter Tax Number\t";
cin >> tax_number;
}
int calculateNet(){
int gross_salary; 
int deductions;
cout << "Enter Gross Salary\t";
cin >> gross_salary;
cout << "Enter deductions\t";
cin >> deductions;
int netsalary = gross_salary - deductions;
cout << "Salary Structure\n";
cout << "Gross Salary:\t";
cout << gross_salary << "\n";
cout << "Deductions: \t";
cout << deductions << "\n";
cout << "Netsalary\t";
cout << netsalary;
}
};
int main() {
emp emp1;
emp1.getInfo("Felix", 635932, 23);
salary emp2;
emp2.getSalary();
emp2.calculateNet();
}
Posted
Updated 6-Nov-17 2:02am
v3
Comments
OriginalGriff 10-Oct-17 8:55am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with. Perhaps if you told us exactly what you did to get the message it might help?
Use the "Improve question" widget to edit your question and provide better information.
Felix Mensah 10-Oct-17 9:51am    
you are right OriginalGriff . Because of the error i was working online and my code worked just fine
#include <iostream>

using namespace std;

class emp {
public:
char* emp_name;
int getInfo(char* emp_name, int emp_id_number, int emp_age) {
cout << "Employee Name: " << emp_name << "\n";
cout << "Employee Id Number: " << emp_id_number << "\n";
cout << "Employee Age: " << emp_age;
}
};
class salary: public emp{
public:

int getSalary(){
int tax_number;
cout << "\nEnter Tax Number\t";
cin >> tax_number;
}
int calculateNet(){
int gross_salary;
int deductions;
cout << "Enter Gross Salary\t";
cin >> gross_salary;
cout << "Enter deductions\t";
cin >> deductions;
int netsalary = gross_salary - deductions;
cout << "Salary Structure\n";
cout << "Gross Salary:\t";
cout << gross_salary << "\n";
cout << "Deductions: \t";
cout << deductions << "\n";
cout << "Netsalary\t";
cout << netsalary;
}
};
int main() {
emp emp1;
emp1.getInfo("Felix", 635932, 23);
salary emp2;
emp2.getSalary();
emp2.calculateNet();
}
Jochen Arndt 10-Oct-17 9:18am    
Is that the exact error message?
I ask because 'path' is a system environment variable that should be always present and you should see a different message when being cleared.
Felix Mensah 10-Oct-17 9:53am    
What do you suggest I do Jochen. should i copy the path where the project is and add it as a variable?
Jochen Arndt 10-Oct-17 9:57am    
I suggest nothing.
I asked if "path is not recognised as an internal or external command" is the exact error message or if you - for example - replaced something with 'path'.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900