0
How do you pass a char * function as an argument within a function? (Solved)
I am trying to pass the char * function to return the pointer in order to latter create a dynamic char * size. In line 74 I have an incompatible pointer type ‘char * (*)(void). https://code.sololearn.com/caR1K53CBvZm/?ref=app
1 ответ
+ 1
the warning tells you exactly what it is. It says :
----
" assignment to 'char *' from incompatible pointer type 'char * (*)(void)' "
-----
< newnode->data.somestr > is expecting a data type < char * >. you are passing in <strfun>, which is just a < char*(*)() >, you have to call <strfun>:
--------
newnode->data.somestr = strfun(); // line 74
--------