I have char data type that contain a directory with double slashes. I want to replace the double slashes to four slashes so that my output will be double slashes. I had tried a lots of solutions, but nothing works.
char *str = "C:\\Users\\user\\desktop";
for(int i = 0;i < strlen(str) ; i++)
if(str[i] == '\\')
str[i] =='\\\\';
The output of this code shows 'C:\Users\user\desktop'.