From: "Al Combs" Newsgroups: comp.os.msdos.djgpp Subject: Re: Templates? What templates? Date: Fri, 24 Sep 1999 16:09:10 -0500 Organization: University of Illinois at Urbana-Champaign Message-ID: <7sgp47$svt$1@vixen.cso.uiuc.edu> References: NNTP-Posting-Host: spider.cso.uiuc.edu X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Proxy-Client: acombs AT uiuc DOT edu from PPPa20-ResaleChampaign1-4R1141.saturn.bbn.com Lines: 64 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Ok... here ya go... (BTW, array is a data type w/ a template) in my array.h file: template class Array { public: Array(void); private: Etype y; }; in array.C: #include "array.h" template Array::Array(void) { y = 0; } in main.C: #include "array.h" int main(void) { Array x; return 0; } The code may not be the best, but I'm still learning. Please help me, if you can. Eli Zaretskii wrote in message ... > >On Wed, 22 Sep 1999, Al Combs wrote: > >> I ws wondering if anyone knows the basic layout for templates using the g++ >> compiler? I'm in a C++ class, and we use CC to compile. The templates we >> have to design for CC are not compatable for g++. I need to know how to >> switch back and forth. I understand CC uses the standard ANSI way. When is >> g++ gonna support the standard? > >AFAIK, g++ supports the standard. Please post sample code that is >accepted by CC (on what platform, btw? CC doesn't tell anything about the >machine and the OS) but rejected by g++. > >Also, what version of g++ are you using?