delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/09/13:48:34

From: Jesus Gil y Gil <javiputa AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: help with C
Date: Wed, 08 Mar 2000 01:34:48 +0100
Organization: Iddeo - Retevisión
Lines: 51
Message-ID: <38C5A027.DE4BDDC0@hotmail.com>
References: <8a3ps6$gba$1 AT news3 DOT icx DOT net>
NNTP-Posting-Host: 212.89.0.4
Mime-Version: 1.0
X-Mailer: Mozilla 4.72 [en] (Win98; U)
X-Accept-Language: en
X-Original-NNTP-Posting-Host: cm00123.telecable.es
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

You declared the function as product(int x,int y)
but you implemented it so: pruduct(int x,int y)
So be carefull when typing...


Lonnie Lee wrote:

>   I am tring to learn "c" and in doing so I have bought a book called "Sams
> Teach Yourself C in 21 Days".  I guess is a good but but most examples do
> not work! Got to debug them. This is a good learning tool , I guess, but
> does not explain how. Below is a code that does not work:
>
> /* Program to Calculate the product of two numbers. */
> #include <stdio.h>
>
> int a,b,c;
>
> int product(int x, int y) ;
>
> int main()
> {
> /*Get the first number*/
> printf("Enter a number between 1 and 100: ");
> scanf("%d",&a);
>
> /*Get the seconde number*/
> printf("Enter another number between 1 and 100: ");
> scanf("%d",&b);
>
> /* Calculate and display the product */
> c = product(a, b);
> printf("%d times %d = %d\n" ,a ,b ,c);
>
> return 0;
>
> }
> /* Function returns the product of the two values provide */
> int pruduct(int x, int y)
> {
> return (x * y);
> }
>
> OK you can "compile" no problem but when you go to build it you get an
> error.
> "undefined reference to 'product'"
> If anyone could help I would appreciate it. If there is a site or newsgroup
> where I need to go that would be great. Because I am tring to learn it would
> be great if I have a resource for informatiom.
>
> Thanks all Lonnie

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019