Thanks all for your time..........
From this arises another problem:
Code:
void mycpy(char *d,char *s);
int main()
{
char *dest,*src ;//= "google";
*src = "google" ;
mycpy(dest,src);
printf("content of dest:%s\n",dest);
printf("content of src:%s\n",src);
return 0;
}
void mycpy(char *d,char *s)
{
while((*d++ = *s++),*s!='\0') line L
//while((*d++ = *s++)) line J
*d = '\0'; // add null char at the last
printf("In mycpy content of dest:%s\n",d);
printf("In mycpy content of src:%s\n",s);
}
Another crash at line L........same with line J uncommented
Looks like i need a more understanding on this.....
What may be the reason for this crash?