Hi all,
I have a string and I want to append (") at the beginning and the end of it to get:
"String.....".
This is my program which works fine but it needs "(s) ( becuase the required command is: cygpath -w "string").
If there is any unlogical implementation in the code, please let me know.Code:void converter( char *cyg, char *win) { FILE *fp; char command[1000] = "cygpath -w "; strcat( command, cyg); fp = popen(command, "r"); if (fp == NULL) { printf("Error in opening pipe"); exit(1); } while(fgets(win, 1000, fp) != NULL) if (pclose(fp) == -1) { printf("Error is countered in closing the pipe "); } }
Wait your help.