# Template classes question in c++

**URL:** <https://forum.kirupa.com/t/template-classes-question-in-c/239464>\
**Category:** Uncategorized\
**Created:** [September 21, 2007, 11:47pm UTC](https://forum.kirupa.com/t/template-classes-question-in-c/239464 "2007-09-21T23:47:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wo1olf](https://avatars.discourse-cdn.com/v4/letter/w/278dde/32.png) [@wo1olf](https://forum.kirupa.com/u/wo1olf)\
**Post date:** [September 21, 2007, 11:47pm UTC](https://forum.kirupa.com/t/template-classes-question-in-c/239464/1 "2007-09-21T23:47:44Z")

</div>

i have this class (template) “a” that has another type of class (also a template) “b” as a private attribute. The thing is in my work i can only include the first (a)class in the main.cpp file, not the second one (b). Is it allowed to include a class in to another one since i can’t put both in the main cpp file? Or it may cause some problems?  
Another question: if the attribute b is also a pointer, is this the right way to declared it  
b\<T\>\* ptr;  
because when i try to compilde the code, i got some errors and it seems like the compiler doesn’t recognize that syntax
