I am using c++. If I want to implement the the two constructors from the header
ID: 3850488 • Letter: I
Question
I am using c++. If I want to implement the the two constructors from the header file how do I go about doing that in my own implementation file.
#pragma once
#ifndef __Lecture_5__Transform__
#define __Lecture_5__Transform__
class Transform
{
public:
Transform(); // Identity Matrix
Transform(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23,
float m30, float m31, float m32, float m33); // Explicit ctor
// Accessors
float get(unsigned int row, unsigned int col) const;
void set(unsigned int row, unsigned int col, float value);
// Operations
Transform operator*(const Transform& rhs) const;
private:
float data[4][4];
};
#endif /* defined(__Lecture_5__Transform__) */
Explanation / Answer
two constructors can be implemented from the header file by,
(i) using inline function
class Transform()
{
public:
inline Transform()
};
inline Transform::Transform()
{ }
(ii)
Transform::Transform() { }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.