C/C++ >> Advice Please.
Posted by speedy11 on 23:02:00 02-15-2002
I have to write a program with these functions included in it,,,but not sure how to describe the fuctions declarations in terms of the value and argument list used.

i) Void my_func(void);

ii) int main(int argc, char *argv[]);

iii) long *all_long(int num, int i[20]);

iv) void many_args(char *s, int i[], double f);

v) FILE *file_func(char *fn[], char *m[],int num);

Can some body tell me what these functions mean please.
[ This Message was edited by: speedy11 on 2002-02-15 23:03 ]

[ This Message was edited by: speedy11 on 2002-02-17 01:37 ]
Posted by justin on 03:11:00 02-19-2002
void my_func(void); revieves nothing, returns nothing
int main(int argc, char *argc[]); revieves an int (argc) telling how big the argv is. argv is an array of strings (command line arguments). main returns an error value (usually 0 for no error)
long *al_long(int num, int i[20]); al_long recieves a long num, and an arrayi of size 20, and returns a pointer to a long (be careful not to have the pointer point to a local variable inside the functionor you could have problems)
void many_args(char *s, int i[], double f); many_args recieves a pointer to a char (probably a string), an in i, of an unknown size, to be determined upon the function call, may be determined by 'sizeof(i) / sizeof(i[0]);' alsp the double value f is recieved, but nothing is returned by many_args.
FILE *file_func(char *fn[], char *m[], int num); file_func recieves an array of chars pointers (fn), it is probably an array of strings, and the same goes for m. num is an int possibly telling how big the arrays are. file_func returns a FILE pointer structure referencing an the possibility of an opened file.
as to what the functions do, that is currently undefined... (as far as you have told us)
Posted by speedy11 on 01:15:00 02-20-2002
Thankyou For Your Help.