我有这些辅助功能:C++ libgen.h(MinGW的)失踪vc140 64项目 - 辅助功能
std::string
pathname_directory(const std::string &pathname)
{
char buffer[pathname.size() + 1];
memset(buffer, 0, sizeof(buffer));
std::copy(pathname.begin(), pathname.end(), buffer);
return std::string(dirname(buffer));
}
std::string
pathname_sans_directory(const std::string &pathname)
{
char buffer[pathname.size() + 1];
memset(buffer, 0, sizeof(buffer));
std::copy(pathname.begin(), pathname.end(), buffer);
return std::string(basename(buffer));
}
依靠libgen.h,一个MinGW的头。 1)为什么VS给出包含“char buffer [pathname.size()+ 1];”的行的错误“expression must have constant value”?
2)VS 2015中是否有预定义的函数来处理这个问题?
什么是msvc2014? – rubenvb
微软视觉工作室编译器2015年(由于某种原因称为2014年)? –
你错了。 Microsoft Visual Studio 2015的编译器版本号是14.这里没有一年。 – rubenvb