Hi All
I have program:
In this free() is failing. I am not able to understand why>Code:#include<stdio.h> void main() { char *pd,*ps="I LOVE CAKE"; int i = strlen(ps); pd=(char *)malloc(strlen(ps)); strcpy(pd,ps); printf("%s",pd); free(pd); getchar(); }
Since pd has it know memory and I don't see any issue while deleting it.
Can any body help in this?
Thanks