tengo un programa en C:error: argumento de tipo no válido de '* unario' (tiene 'int')
#include <stdio.h>
int main(){
int b = 10; //assign the integer 10 to variable 'b'
int *a; //declare a pointer to an integer 'a'
a=(int *)&b; //Get the memory location of variable 'b' cast it
//to an int pointer and assign it to pointer 'a'
int *c; //declare a pointer to an integer 'c'
c=(int *)&a; //Get the memory location of variable 'a' which is
//a pointer to 'b'. Cast that to an int pointer
//and assign it to pointer 'c'.
printf("%d",(**c)); //ERROR HAPPENS HERE.
return 0;
}
compilador produce un error:
error: invalid type argument of ‘unary *’ (have ‘int’)
Puede alguien explicar lo que este error ¿medio?
También tenga en cuenta la falta de moldes en la respuesta. Los moldes en la pregunta ocultan los problemas en la línea que está asignando un 'int **' a un 'int *'. ('c = (int *) & a;') – Thanatos