delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/07/17:07:47

From: "Lonnie Lee" <airtime AT kih DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: help with C
Date: Wed, 8 Mar 2000 13:47:30 -0600
Organization: ICX Online, Inc.
Lines: 49
Message-ID: <8a3ps6$gba$1@news3.icx.net>
NNTP-Posting-Host: lei121.kih.net
X-Trace: news3.icx.net 952462022 16746 209.209.151.121 (7 Mar 2000 20:47:02 GMT)
X-Complaints-To: abuse AT icx DOT net
NNTP-Posting-Date: 7 Mar 2000 20:47:02 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

  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