Inhert from two diffrent files?

Is it possible to Inhert this class from my ObjectH.h file into my other header file's or cpp file?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
struct Vertex	//Overloaded Vertex Structure
{
	Vertex(){}
	Vertex(float x, float y, float z,float r, float g, float b , float a)
	: Position(x,y,z), Color(r,g,b,a){}
	XMFLOAT3 Position;
	XMFLOAT4 Color;
};
class Object
{
		struct Transform
		{
			struct Position
			{
				float x,y,z;
			};
			struct Scale
			{
				float x,y,z;
			};
			struct Rotation
			{
				float x,y,z;
			};
		};		
		public:
		Object();
		void Update();
		Vertex vertices[];
};
Yes of course, you should only include header file in which your base class is declared
Would you mind giving me a example?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Object.h
#ifndef OBJ_H
#define OBJ_H

class Object {
. . .
};

#endif


// Derived.h
#ifndef DERIVED_H
#define DERIVED_H

#include"Object.h"

class Derived : public Object
{
 . . .
};
#endif 
Topic archived. No new replies allowed.