If I have the following code:
--------------
main()
{ 
 
    char *filename;
    char *string = "this is a string";
 
    strcpy(filename,string);
    printf("filename is %s\n",filename);
}
--------------
 
it gives me a segmentation fault when I compile it using one c++ compiler while on other it works fine.Why???
 
Regds,
Anubhav
 

Reply via email to