0

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){};

BRHSM
  • 854
  • 3
  • 13
  • 48

1 Answers1

2

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) { }.

tonso
  • 1,760
  • 1
  • 11
  • 19
  • I changed it to `char*` bu i get an warning: `implicit declaration of function ‘func1’ ` and an error `invalid use of void expression` – BRHSM Mar 12 '15 at 10:11
  • 1
    1) Then declare `func1` before the first usage 2) I don't understand, provide more detail – tonso Mar 12 '15 at 10:16
  • I got it' i diden't change the `void` to `char*` in the header file – BRHSM Mar 12 '15 at 10:17