View Single Post
Join Date: Dec 2007
Posts: 68
Reputation: Rhohitman is an unknown quantity at this point 
Solved Threads: 4
Rhohitman's Avatar
Rhohitman Rhohitman is offline Offline
Junior Poster in Training

How to use typedef for the template structure? What its syntax?

 
0
  #1
Oct 10th, 2008
I create the simple template structure like this
  1. #include <iostream>
  2.  
  3. template <class info>
  4. struct box
  5. {
  6. info data;
  7. };
  8.  
  9. int main()
  10. {
  11. box<int> b1;
  12. b1.data = 1;
  13. std::cout<<b1.data;
  14. return 0;typedef box square;
  15. }

Now i want to use the typedef for this template structure.
I could not figure out the syntax...
as i tried
  1. typedef box square;

But i didn't workout... Please help me..
Last edited by Rhohitman; Oct 10th, 2008 at 2:34 am. Reason: mistakely pressed tab and enter.. as it was summited without completion
Reply With Quote