What I want to do is to return the memory address of the CADE string that I generate in the function and assign it to the CHAIN pointer. But when I execute it, I mark the following error and try to solve it but it still does not work.
ERROR: invalid conversion from char' to
char * '
From what I understand it is because I can not assign it since one is char and the other is a pointer to a char. But how is the solution for you to do what I explained before? Thank you.
#include <stdio.h>
char * ingresa_cadena();
int main()
{
char *cadena;
cadena=ingresa_cadena();
printf ("La cadena ingresada es %c", cadena);
system("PAUSE");
return 0;
}
char * ingresa_cadena()
{
char cade[25];
gets(cade);
return (&cade); }