I\'m trying to do the below in my function but keep getting a segmentation fault error. It\'s failing when I\'m trying to use [iModify - 1] as my index.
[iModify - 1]
Can
You have used char name_num[] = {'\0'}; in your code. name_num has the length of 1 char, which is too short to hold a string later.
char name_num[] = {'\0'};
name_num
char
Therefore, you are writing out-of-bounds when you read name_num.