So I have function that logs some data and writes that to a file and returns the path to the file as a string.
I then need to take that string and pass it to a function that parses the file and places the data in a structure
before the file can be parsed though, the string path needs to be "transformed" so each directory delimiter includes the escape character for the backslash. for this I pass the string to another function.
At a high level this seems like a very easy task, but I believe I am not passing the original return string correctly to the other functions, because when I check the output in the console after I have transformed I receive the gibberish characters. below is a simplified example of what I am trying to do. I know my method of transformation is not the problem because if I take the lines of code that are in the nested transform function and put them in main(), everything works smooth, so it must be the way I am passing the pointer through the other functions and then trying to operate.
main(){
char* filePath = logData();
parseData(filePath);
}
int parseData(char* filePath){
char* transformFile = transFormPath(filePath);
//parse data from transformFile
return 0;
}
char* transFormPath(char* filePath){
//transform filePath to newPath
return newPath;
}
any help would be greatly appreciated, thanks!