【发布时间】:2014-06-23 11:54:54
【问题描述】:
我有以下函数(来自 lionet asn1 编译器 API):
int xer_fprint(FILE *stream, struct asn_TYPE_descriptor_s *td, void *sptr);
第一个参数是 FILE*,这是输出的地方。
这行得通:
xer_fprint(stdout, &asn_struct, obj);
这也是如此:
FILE* f = fopen("test.xml", "w");
xer_fprint(f, &asn_struct, obj);
fclose(f);
但我需要将这些数据放在一个字符串中(最好是 std::string)。
我该怎么做?
【问题讨论】: