Does C++ have any equivalent to python's function os.path.join
? Basically, I'm looking for something that combines two (or more) parts of a file path so that you don't have to worry about making sure the two parts fit together perfectly. If it's in Qt, that would be cool too.
Basically I spent an hour debugging some code and at least part of it was because root + filename
had to be root/ + filename
, and I'm looking to avoid that in the future.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…