Re: [Dev-C++] using classes in seprate files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Hossein H. <ult...@em...> - 2004-04-17 12:41:13
|
<P>> hi anybody </P> <P>Hi Faramarz,</P> <P><BR>> i have a problem to using seprate c++ classes. <BR>> i have write a class "Search.cpp",it has two function in it. <BR>> it has not any main function. <BR>> now i want to write another file for example test_search <BR>> i want to instantiate an object from Search class in it and use it's <BR>> function there. <BR>> i wrote: <BR>> Search s; <BR>> s.linear(); <BR>> but i can not use class Search in it because compiler does not know it. <BR>> what should i do? <BR>> in dev_c++ or borland c++? <BR>> thank u in advanced <BR></P> <P>Just as an endpoint to all the correct isseues mentioned by the others, don't forget to add that cpp file to your project. In DevC++, you can do that using the Project|Add to Project menu-instruction. There is a similar mechinary in almost all C++ implementations, including Borland C++ Builder.</P> <P>Regards,<BR>--Hossein</P><BR> -- <p>__________________________________________________________<br> Sign-up for Ads Free at Mail.com<br> <a href="http://mail01.mail.com/scripts/payment/adtracking.cgi?bannercode=adsfreejump01" target="_blank">http://www.mail.com/?sr=signup</a></p> |