Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » difference between a procedure and a function
Closed Thread
Old 12-16-2004, 10:45 AM   #1 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default difference between a procedure and a function

Hi
I came across this definition of a procedure and a function.

it states that a function does not have a return value
while a function has a return value.

is that the difference?
rookie1010 is offline  
Old 12-16-2004, 02:13 PM   #2 (permalink)
 
Junior Techie

Join Date: Dec 2004

Posts: 88

developer

Default

it states that a function does not have a return value
while a function has a return value.

I think you wanted to say a procedure doesnt return a value and function does. This is true.
In VB there is a Sub which doesnt return a value and there is a function which return a value. In C/C++ we simply give a void in the declaration of the function to indicate it doesnt return a value. But i think in other languages procedure is just another name for function.
__________________
Somewhere I Belong...
developer is offline  
Old 12-16-2004, 02:51 PM   #3 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

And a Method is a function that is a member of an object (in OOP). In most languages, they use function/procedure interchangably. Other languages use just function, just procedure, or just method to describe all of the above.
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
Old 12-16-2004, 06:09 PM   #4 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default

so strictly speaking
a procedure does not return a value and a function does
rookie1010 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On