Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Compilation problems??

Re: Compilation problems??

From: Craig Miller <dcm_at_zilker.net.nospam>
Date: 1997/08/12
Message-ID: <33F11B6F.41C67EA6@zilker.net.nospam>#1/1

Programming wrote:
>
> #include "stdio.h"
>
> int main()
> {
>
> char *ls_returnvalue;
>
> ls_returnvalue = "";
> ls_returnvalue = checkvalue (); /* line 86 */

	At this point, you have not declared the return type of
	check_value(), so the compiler (properly) assumes it is
	a function that returns an int.

	Your later error is because you then *later* declare
	checkvalue() as returning "char *", which conflicts with
	what you indicated above.

	You can either:

		(1) put a function declaration above line 86:
			char *checkvalue();

		(2) or move the definition of checkvalue() above
			main().

	You have to tell the compiler the return type before the
	first call, or the compiler assumed you mean it's an int.

	This is standard C.

	Hope this helps.

		Craig

--
Craig Miller .... Cedar Park, TX .... programmer, homebrewer
         I do not speak for anyone besides myself.
             Remove the .nospam to contact me.
Received on Tue Aug 12 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US