Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
T

tekkie2412

@tekkie2412
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Class/Overloaded funtion help
    T tekkie2412

    thanks, I feel the headache going away already :)

    C / C++ / MFC help c++ question career

  • Class/Overloaded funtion help
    T tekkie2412

    Im reading "teach yourself C++ in 21 days", well Ive been stuck on day 6 for about a week now. Can anyone tell me whats wrong with this source? I keep getting overloaded function errors but I really want to understand this before I move on to day 7. thanks /* Chapter 6 end of lesson program Teach yourself C++ in 21 days */ // simple program to test my knowlege of classes... // make a class that assignes and reads values using public accessors #include class Employee { public: int GetAge() const; void SetAge(int age); int GetYearsOfService() const; void SetYearsOfService(int yearsOfService) const; //Public accessors so that the variables can remain private int GetSalary() const; void SetSalary(int salary); private: int age; int yearsOfService; //Private variables int salary; }; int Employee::GetAge() { return age; } void Employee::SetAge(int age2) { age = age2; } int Employee::GetYearsOfService() { return yearsOfService; } void Employee::SetYearsOfService(int yearsOfService2) { yearsOfService = yearsOfService2 } int Employee::GetSalary() { return salary; } void Employee::SetSalary(int salary2) { salary = salary2; } void main() { int age2, yearsOfService2, salary2; Employee Matt; //define 2 objects of class employee Employee Max; Matt.SetAge(21); Max.SetAge(35); Matt.SetYearsOfService(2); //assign values to the 2 objects Max.SetYearsOfService(6); Matt.SetSalary(20000); Max.SetSalary(34600); cout<<"Matts age is : "; cout<

    C / C++ / MFC help c++ question career
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups