Connecting Tech Pros Worldwide Help | Site Map

prototype problem

Member
 
Join Date: Nov 2006
Location: Antipolo, City
Posts: 55
#1: Nov 18 '06
hello guys, I'm a newbie in this C++ world, can somebody help me to find a solution to my problem in this program:

while ( message (answer , "yes") != 0)

after compiling the program, theres an error that says, " message" needs a prototype....i almost finish the program but this single run time error keeps bugging me.

can somone help me to solve this problem..

by the way I'm using borland C++

thanks,
Expert
 
Join Date: Nov 2006
Location: UK
Posts: 1,320
#2: Nov 18 '06

re: prototype problem


Quote:

Originally Posted by thefarmer

hello guys, I'm a newbie in this C++ world, can somebody help me to find a solution to my problem in this program:

while ( message (answer , "yes") != 0)

after compiling the program, theres an error that says, " message" needs a prototype....i almost finish the program but this single run time error keeps bugging me.

can somone help me to solve this problem..

by the way I'm using borland C++

thanks,

before C++ can call a function it needs to know the number and type of the parameters -

message appears to be a function which takes two parameters (both char *) ?

you either put the definition of the function before you can call it or you declare a prototype, e.g.
Expand|Select|Wrap|Line Numbers
  1.  int message (char *, char *);
  2.  
Member
 
Join Date: Jul 2006
Posts: 44
#3: Nov 20 '06

re: prototype problem


hi,
this is abhinay,
one way to solve ur prob. is give function defination before calling the function or give prototype ie only declaration of function with currect number of parameter,
ie inform compiler that what ever function i m using it have defination somewhere in code.

Abhinay
Reply