I've been noticing this strange behaviour with string concatenation despite the fact that strcmp
returns zero, showing both forms are identical
The include file options.h
is as follows
struct options = {
std::string ctifile;
...
};
The main file is being written in two ways
Method 1
#include "options.h"
#include <string>
#include "cantera/IdealGasMix.h"
options opt = {
"mech/tot.cti"
};
IdealGasMix gas(opt.ctifile, ...);
In the second method,
#include "options.h"
#include <string>
#include "cantera/IdealGasMix.h"
options opt = {
"tot.cti"
};
IdealGasMix gas(std::string("mech/") + opt.ctifile, ...);
For some reason, only Method 2 is unable to find the file specified. Any pointers? (pun intended)