使用outtext函数遇到问题

0

用的VS2019编译器 下面的代码出现了两个问题

1.严重性 代码 说明 项目 文件 行 禁止显示状态
错误(活动) E0304 没有与参数列表匹配的 重载函数 "outtext" 实例 thesis D:\VS2019projects\thesis\thesis.cpp 7

2.严重性 代码 说明 项目 文件 行 禁止显示状态
错误 C2665 “outtext”: 2 个重载中没有一个可以转换所有参数类型 thesis D:\VS2019projects\thesis\thesis.cpp 16

initgraph(1000, 800);
char s[ ] ="Hello Summer";
outtext(s);
system("pause");
return 0;
ava
钢铁雄狮

2020-6-10

1

VS2019 的项目默认使用 Unicode 编码。所以,你要用 Unicode 字符串。

你的代码可以这样改:

initgraph(1000, 800);
wchar_t s[] = L"Hello Summer";
outtext(s);
system("pause");
return 0;
ava
慢羊羊

2020-6-10

技术讨论社区