So, I have a struct member char* and I want to initialize it after allocating node memory .However,this method gets me a Seg Fault. Note. YES, I want a infoPtr. Excuse any syntax errors, these are not the problem I am trying to solve . ALL I want is to correctly pass a char string into name.
struct Info{
char *name;
}
typedef struct Info *infoPtr;
int main(void){
enter("google");
}
void enter(char *name){
infoPtr* info=(infoPtr)malloc(sizeof(infoPtr));
info->name=strup(name);
}