Last active
December 17, 2015 08:29
-
-
Save nitrix/5580765 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "Student.hpp" | |
| int main() | |
| { | |
| //Creating a new student object | |
| Student cmaxomux(45, 4.0); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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