hi,
please see the code below:
void main()
{
int i,len;
char* str = "shalaka";
char temp;
len=strlen(str) - 1;
for(i=0;i<strlen(str)/2;i++)
{
temp = str[i];
str[i] = str[len];
str[len--]=temp;
}
}
str[i] = str[len]; => my program throws an exception at this line . Why?
Best Regards,
Shalak