我正在尝试使用像这样的 stbi_load
函数加载一些图像:
stbi_load(filename, parameter2, parameter3, parameter4, parameter5);
问题是我的文件名是这样的:
stbi_load("example_filename",...);
但是函数要求第一个参数是const char*
。我试过转换但它没有加载图像。我正在使用 Visual Studio 2017。
最佳答案
stbi_load("example_filename",...);
But the functions requires the first parameter to be const char*. I tried casting but it didn't work.
字符串文字隐式转换为 const char*
所以这不是问题。没有必要投它。移除类型转换,它应该可以工作,除非您有其他未向我们展示的问题。
关于c++ - stbi_load 文件名到 const char*,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56906366/