小编Pet*_*riu的帖子

涉及iostream和wstring的奇怪的C++行为

我有两个文件,my_program.cpp它的标题my_program.h.

my_program.cpp包含这个:

#include "my_program.h"
using namespace std;
Run Code Online (Sandbox Code Playgroud)

my_program.h包含指向返回a的函数的指针wstring,如下所示:

using namespace std;
typedef wstring (*my_function)(wstring, int, int, int, int);
Run Code Online (Sandbox Code Playgroud)

程序不会在这种状态下编译(在typedef处停止...说ISO C++禁止声明'wstring'没有类型),但如果我#include <iostream>之前#include "my_program.h"在.cpp文件中添加,程序会奇迹般地编译.

为什么会这样?我只是希望我没有犯下愚蠢的错误,现在我会被嘲笑.

c++ iostream wstring

1
推荐指数
1
解决办法
405
查看次数

使用FluidSynth非迭代地获取声音文件中的乐器列表

是否有一个函数可以返回FluidSynth中声音文件中所有乐器(预设名称)的列表,或至少返回每个音库中的预设数量?

instruments soundfont

1
推荐指数
1
解决办法
1704
查看次数

标签 统计

c++ ×1

instruments ×1

iostream ×1

soundfont ×1

wstring ×1