Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Other Sciences
Programming and Computer Science
Where is the Employee.cpp file located in the code?
Reply to thread
Message
[QUOTE="member 428835, post: 6852449"] I have the following two files stored in the folder "impl" on my Desktop, the CLion IDE and am running on a mac: main.cpp: [code=cpp] #include <iostream> #include "Employee.h" int main() { Employee e1("Bradly", "E007"); Employee e2("John", "E425"); std::cout << e1.getName() << ": " << e1.getId() << "\n"; e1.setName("Brad"); std::cout << e1.getName() << ": " << e1.getId() << "\n"; std::cout << e2.getName() << ": " << e2.getId() << "\n"; return 0; } [/code] and then a header file Employee.h [code=cpp] #pragma once #include <string> class Employee { public: Employee(std::string name, std::string id); std::string getName() const; std::string getId() const; void setName(std::string name); private: std::string m_name; std::string m_id; }; [/code] When clicking the green triangle "run" (see the arrow in the image) I get the error the image shows (see the file structure upper left if this helps): [ATTACH type="full"]321936[/ATTACH] Any idea what I'm doing wrong? Thanks so much! [/QUOTE]
Insert quotes…
Post reply
Forums
Other Sciences
Programming and Computer Science
Where is the Employee.cpp file located in the code?
Back
Top