Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 02-27-2006, 03:31 PM   #1 (permalink)
 
Junior Techie

Join Date: May 2005

Posts: 66

dingdong-man

Default C function principle...

i'm learning C now. i'm a bit confused with the function on which the programmer puts like following:

void function call (); OR
int function call (); OR sometimes got
void function call (int a, const int *b[]);

when is the condition that we should use each of this function ? how could the pointer is in the prototypes e.g. const int * b[] ?

thnx....
dingdong-man is offline  
Old 02-28-2006, 10:23 PM   #2 (permalink)
 
Super Techie

Join Date: May 2005

Posts: 479

furtivefelon

Default

the first keyword of any function definition (void, int, char, whatever), tells the function what value type the function will return..

If you write void, you can't return anything (as it's not expecting anything)

and if you put anything in the parameter (after function call, with in the brackets), it can be any type, even pointers/typedef types..

These concepts should be covered in any introductary text, are you sure your learning C and not skipping anything?
__________________
lisp hacker
running: FreeBSD 5.4 - still learning
develop with: SBCL + emacs for lisp, Anjuta IDE +gcc for c, SPE for python..
browse with: opera
furtivefelon 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