Following code fails at line # 7 with exit code -1

1. void my_swap_chars(uint8_t *str1,uint8_t *str2) {
2.   uint8_t temp1;
3.   uint8_t temp2;
4.   printf("1:s1:%p s2:%p s1:%c s2:%c\n",str1,str2,*str1,*str2);
5.   temp1 = *str1;
6.   temp2 = *str2;
7.   *str1 = temp2; <<--
8.   *str2 = temp1;
9. }

Repl link:

code snippet

Hey @jankeshchakrava welcome to the forums!

Please format your code like this

```language
Code
```
1 Like