Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!samsung!uunet!cimshop!davidm From: cimshop!davidm@uunet.UU.NET (David S. Masterson) Newsgroups: comp.lang.c++ Subject: Re: Inline member functions in .c file Message-ID: Date: 2 Jan 91 18:22:47 GMT References: <1990Dec31.183500.1370@athena.mit.edu> Sender: davidm@cimshop.UUCP Organization: Consilium Inc., Mountain View, California Lines: 34 In-reply-to: ahmed@athena.mit.edu's message of 31 Dec 90 18:35:00 GMT X-Posting-Software: GNUS 3.12 [ NNTP-based News Reader for GNU Emacs ] >>>>> On 31 Dec 90 18:35:00 GMT, ahmed@athena.mit.edu (Shamim Ahmed) said: Shamim> Hi! Shamim> I am trying to define an inline member function of a class in the Shamim> .c file after declaring it in the .h file as follows: Shamim> // file A.h Shamim> class A Shamim> { Shamim> public: Shamim> char *xx(); Shamim> //..... Shamim> }; Shamim> // file A.c Shamim> #include "A.h" Shamim> inline char* A::xx() Shamim> { Shamim> // .... Shamim> } A::xx() needs to be declared as inline in A.h or it will be treated as "outline". Also, you'll probably want to put the definition of the A::xx() in the .H file or programs including A.h will not be able to find it (since it's resolved by CPP). -- ==================================================================== David Masterson Consilium, Inc. (415) 691-6311 640 Clyde Ct. uunet!cimshop!davidm Mtn. View, CA 94043 ==================================================================== "If someone thinks they know what I said, then I didn't say it!"