Originally Posted by misplaced
>TRY koo= (struct p *) malloc(sizeof(p));
Lose the cast, it only serves to hide more subtle errors. And it should be:
Because p is not a typedef'd struct, you must have the struct keyword unless compiling as C++ by accident. Though the OP had the right of it with this:Code:koo = malloc ( sizeof ( struct p ) );
Code:koo = malloc ( sizeof *koo );