0
내가 두 형태를 보여 strcmp
는 0을 반환한다는 사실에도 불구하고 문자열 연결이 이상한 행동을 몰래 봤는데은 이상한 C++ 문자열 연결 동작
struct options = {
std::string ctifile;
...
};
을 다음과 같이 파일 options.h
이 포함 동일 주 파일은 두 가지 방법으로
방법 1
#include "options.h"
#include <string>
#include "cantera/IdealGasMix.h"
options opt = {
"mech/tot.cti"
};
IdealGasMix gas(opt.ctifile, ...);
에 기록되는 두 번째 방법은
, 어떤 이유
#include "options.h"
#include <string>
#include "cantera/IdealGasMix.h"
options opt = {
"tot.cti"
};
IdealGasMix gas(std::string("mech/") + opt.ctifile, ...);
만 방법이 지정한 파일을 찾을 수 없습니다. 어떤 포인터? (말장난 의도)
[작동하지 않아야하는 이유는 없습니다.] (http://cpp.sh/3yln) – amanuel2
뭔가 다른 것이 잘못되어 게시 한 내용이 명확하지 않습니다. 문제를 보여주는 [mcve]를 찾아야합니다. – MicroVirus
나를 위해 일합니다. 나는 당신에게 가스 함수 인수 선언을 의심한다. – Naidu