Skip to content

Instantly share code, notes, and snippets.

@nitrix
Last active December 17, 2015 08:29
Show Gist options
  • Select an option

  • Save nitrix/5580765 to your computer and use it in GitHub Desktop.

Select an option

Save nitrix/5580765 to your computer and use it in GitHub Desktop.
#include "Student.hpp"
int main()
{
//Creating a new student object
Student cmaxomux(45, 4.0);
}
#include "Student.hpp"
#include <iostream>
Student::Student(int semesterHours, float gpa)
{
std::cout << "constructing student" << std::endl;
m_semesterHours = 0;
m_gpa = 0.0;
}
Student::~Student()
{
std::cout << "destructing student" << std::endl;
}
#ifndef STUDENT_HPP
#define STUDENT_HPP
class Student
{
public:
Student(int semesterHours, float gpa);
~Student();
private:
int m_semesterHours;
float m_gpa;
};
#endif //STUDENT_HPP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment