BRHSM
BRHSM

Reputation: 884

can you call a function within the callong of a function in c

Lets say I have 2 functions func1() and func2(s) (just names for easy refrence)

to use func1() i need to run func2(s) which is a void with a pointer to characters in it's decleration: func2(char *string_one){};

can I do this: func1(firststring,func2(s)); in which i add firststring to the result of func2() using 2 pointers just like in func2()?

func1() decleration: func1(char *string_one, char *string_two){};

Upvotes: 0

Views: 39

Answers (1)

tonso
tonso

Reputation: 1768

Having void as return type of func2 doesn't allow to use it as a char * parameter of func1. You have to return char * from func2: char* func2(char* string_one) { }.

Upvotes: 2

Related Questions