#include<stdio.h>
int main()
{
char *c;
c = "hello";
c = "name";
return 0;
}
The above code compiles fine but below gives seg fualt at run time
#include<stdio.h>
int main()
{
char *c;
c = "hello";
*c = 'A';
return 0;
}
#include<stdio.h>
int main()
{
char *c;
c = "hello";
c = "name";
return 0;
}
The above code compiles fine but below gives seg fualt at run time
#include<stdio.h>
int main()
{
char *c;
c = "hello";
*c = 'A';
return 0;
}