开发者

quickfix: how to convert FIX::Account to a c_string or other types

I am using quickfixengine to build a FIX application. quickfix almost has no documentation, pretty much like a blackhole. I have a variable which is a FIX::Account type. I know it is a FIX string type, but how do I get the string out (to be a c-string). I tried something like this, it does not pass the compilation.

FIX::Account acct;

// populate  acct somewhere else

printf(acct.c_str());

Compiler error is error: ‘class FIX::Account’ has no member named ‘c_str’

basically, I'd like to know how to get to know the constructor, interface of every FIX types? which files contain these?

开发者_StackOverflow社区

thank you


I assume you're using the C++ API. In this case, all fields inherit from FIX::FieldBase which has a convenient getString() method (see here).

I agree that is not easy to understand at a glance the declarations of FIX fields. That's because all classes related to FIX messages are directly generated from the XML specifications of the FIX protocol.


getValue() method should be used for getting string fields. printf(acct.getValue().c_str());

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜