Here is a clipping of my code, I know that the segmentation fault happens in the else condition
char* testCase = "AAAAA\0";
string salt = "50";
for (int i = 0; i <= 5; i++)
{
//Create random 5 character string
if (testCase[i] == '\0')
{
break;
}
else
{
testCase[i] = 'z';
}
}
I have no clue why as I've ran several tests such as running printf("%c", testCase[i]);
and this prints the element to the console just fine no issue so I'm stuck on why it might be happening in the else condition since I clearly have access to that memory.