You did not allocate in using malloc(), so no.
i have a question in line 10:
pmystruct temp=(pmystruct)malloc(sizeof(pmystruct*)) ;
shouldn't you use sizeof(pmystruct);
Last edited on
shouldnt u use
pmystruct temp = (pmystruct)malloc(sizeof(mystruct)); ?
And shoulnd't you first alocate memory to pb->pchr before assigning a value to it?
There's so many things wrong here, it's hard to know where to start. Just go back to the beginning of your book's chapter on pointers and start over.